mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-10 12:05:55 +00:00
Merge branch 'master' of http://gitbox.apache.org/repos/asf/commons-collections.git
This commit is contained in:
commit
42909f82d9
@ -274,12 +274,7 @@ public class CursorableLinkedList<E> extends AbstractLinkedList<E> implements Se
|
||||
protected void registerCursor(final Cursor<E> cursor) {
|
||||
// We take this opportunity to clean the cursors list
|
||||
// of WeakReference objects to garbage-collected cursors.
|
||||
for (final Iterator<WeakReference<Cursor<E>>> it = cursors.iterator(); it.hasNext();) {
|
||||
final WeakReference<Cursor<E>> ref = it.next();
|
||||
if (ref.get() == null) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
cursors.removeIf(ref -> ref.get() == null);
|
||||
cursors.add(new WeakReference<>(cursor));
|
||||
}
|
||||
|
||||
|
@ -261,14 +261,10 @@ public class ListOrderedSet<E>
|
||||
if (result == false) {
|
||||
return false;
|
||||
}
|
||||
if (decorated().size() == 0) {
|
||||
if (decorated().isEmpty()) {
|
||||
setOrder.clear();
|
||||
} else {
|
||||
for (final Iterator<E> it = setOrder.iterator(); it.hasNext();) {
|
||||
if (!decorated().contains(it.next())) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
setOrder.removeIf(e -> !decorated().contains(e));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user