bodewig 2002/07/04 08:04:07
Modified: src/main/org/apache/tools/ant/util Tag: ANT_15_BRANCH
CollectionUtils.java
Log:
Simplified version of CollectionUtils.
Revision Changes Path
No revision
No revision
1.1.2.2 +6 -10 jakarta-ant/src/main/org/apache/tools/ant/util/CollectionUtils.java
Index: CollectionUtils.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/CollectionUtils.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- CollectionUtils.java 4 Jul 2002 14:54:43 -0000 1.1.2.1
+++ CollectionUtils.java 4 Jul 2002 15:04:07 -0000 1.1.2.2
@@ -92,6 +92,9 @@
}
}
+ // don't need to check e2.hasMoreElements as the Vectors
+ // same size.
+
return true;
}
@@ -125,16 +128,9 @@
}
}
- Enumeration e2 = d2.keys();
- while (e2.hasMoreElements()) {
- Object key = e2.nextElement();
- Object value1 = d2.get(key);
- Object value2 = d1.get(key);
- if (value2 == null || !value1.equals(value2)) {
- return false;
- }
- }
-
+ // don't need the opposite check as the Dictionaries have the
+ // same size, so we've also covered all keys of d2 already.
+
return true;
}
}
--
To unsubscribe, e-mail: <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
|