commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections CollectionUtils.java
Date Mon, 22 Sep 2003 02:20:56 GMT
psteitz     2003/09/21 19:20:56

  Modified:    collections/src/java/org/apache/commons/collections
                        CollectionUtils.java
  Log:
  Fixed optimization logic error in containsAny.
  Iteration should be over the smaller collection.
  
  Revision  Changes    Path
  1.44      +3 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/CollectionUtils.java
  
  Index: CollectionUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/CollectionUtils.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- CollectionUtils.java	21 Sep 2003 23:47:09 -0000	1.43
  +++ CollectionUtils.java	22 Sep 2003 02:20:56 -0000	1.44
  @@ -239,7 +239,7 @@
        * @see #intersection
        */
       public static boolean containsAny(final Collection coll1, final Collection coll2) {
  -        if (coll1.size() > coll2.size()) {
  +        if (coll1.size() < coll2.size()) {
               for (Iterator it = coll1.iterator(); it.hasNext();) {
                   if (coll2.contains(it.next())) {
                       return true;
  
  
  

Mime
View raw message