ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r1367741 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/util/VectorSet.java
Date Tue, 31 Jul 2012 20:15:29 GMT
Author: jglick
Date: Tue Jul 31 20:15:29 2012
New Revision: 1367741

URL: http://svn.apache.org/viewvc?rev=1367741&view=rev
Log:
#53622: faster VectorSet.retainAll.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/util/VectorSet.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1367741&r1=1367740&r2=1367741&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Jul 31 20:15:29 2012
@@ -17,6 +17,9 @@ Changes that could break older environme
 Fixed bugs:
 -----------
 
+ * Made VectorSet faster.
+   Bugzilla Report 53622.
+
  * Incorrect URLs in Ant child POMs.
    Bugzilla Report 53617.
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/VectorSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/VectorSet.java?rev=1367741&r1=1367740&r2=1367741&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/VectorSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/VectorSet.java Tue Jul 31 20:15:29 2012
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.Set;
 import java.util.Vector;
 
 /**
@@ -191,6 +192,9 @@ public final class VectorSet extends Vec
     }
 
     public synchronized boolean retainAll(Collection c) {
+        if (!(c instanceof Set)) {
+            c = new HashSet(c);
+        }
         LinkedList l = new LinkedList();
         for (Iterator i = iterator(); i.hasNext(); ) {
             Object o = i.next();



Mime
View raw message