Skip to content

Commit 84cfe34

Browse files
committed
Use forEach()
1 parent 752aaa4 commit 84cfe34

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,7 @@ public Object[] toArray() {
559559
public <T> T[] toArray(final T[] arr) {
560560
// special implementation to handle disappearing values
561561
final List<V> list = new ArrayList<>(size());
562-
for (final V value : this) {
563-
list.add(value);
564-
}
562+
forEach(list::add);
565563
return list.toArray(arr);
566564
}
567565
}

0 commit comments

Comments
 (0)