[COLLECTIONS-413] Improve performance of DualBidiMap#removeAll. Thanks to Adrian Nistor for report and patch.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1353115 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2012-06-23 12:01:11 +00:00
parent cae889f3c0
commit 6db6aa496f
1 changed files with 2 additions and 5 deletions

View File

@ -346,12 +346,9 @@ public abstract class AbstractDualBidiMap<K, V> implements BidiMap<K, V> {
return false;
}
boolean modified = false;
Iterator<E> it = iterator();
final Iterator<?> it = coll.iterator();
while (it.hasNext()) {
if (coll.contains(it.next())) {
it.remove();
modified = true;
}
modified |= remove(it.next());
}
return modified;
}