[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:
parent
cae889f3c0
commit
6db6aa496f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue