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 752aaa4 commit 84cfe34
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,7 @@ public Object[] toArray() {
public <T> T[] toArray(final T[] arr) {
// special implementation to handle disappearing values
final List<V> list = new ArrayList<>(size());
for (final V value : this) {
list.add(value);
}
forEach(list::add);
return list.toArray(arr);
}
}
Expand Down

0 comments on commit 84cfe34

Please sign in to comment.