Skip to content

Commit 752aaa4

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

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
@@ -430,9 +430,7 @@ public Object[] toArray() {
430430
public <T> T[] toArray(final T[] arr) {
431431
// special implementation to handle disappearing keys
432432
final List<K> list = new ArrayList<>(size());
433-
for (final K key : this) {
434-
list.add(key);
435-
}
433+
forEach(list::add);
436434
return list.toArray(arr);
437435
}
438436
}

0 commit comments

Comments
 (0)