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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]