You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2007/10/03 14:49:47 UTC
svn commit: r581587 -
/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java
Author: peterreilly
Date: Wed Oct 3 05:49:47 2007
New Revision: 581587
URL: http://svn.apache.org/viewvc?rev=581587&view=rev
Log:
checkstyle
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java?rev=581587&r1=581586&r2=581587&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java Wed Oct 3 05:49:47 2007
@@ -104,14 +104,15 @@
//preserve order-encountered using a list; enforce set logic manually:
// (LinkedHashSet better, but JDK 1.4+)
ArrayList union = new ArrayList(rc.size() * 2);
- Set _union = new HashSet(rc.size() * 2);
+ // Use a set as list.contains() can be expensive for lots of resources
+ Set set = new HashSet(rc.size() * 2);
for (Iterator rcIter = rc.iterator(); rcIter.hasNext();) {
for (Iterator r = nextRC(rcIter).iterator(); r.hasNext();) {
Object o = r.next();
if (asString) {
o = o.toString();
}
- if (_union.add(o)) {
+ if (set.add(o)) {
union.add(o);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org