Skip to content

Commit

Permalink
Use forEach()
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 9, 2024
1 parent de4b7f8 commit 752aaa4
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,7 @@ public Object[] toArray() {
public <T> T[] toArray(final T[] arr) {
// special implementation to handle disappearing keys
final List<K> list = new ArrayList<>(size());
for (final K key : this) {
list.add(key);
}
forEach(list::add);
return list.toArray(arr);
}
}
Expand Down

0 comments on commit 752aaa4

Please sign in to comment.