Skip to content

Commit

Permalink
remove todo in java getStrings
Browse files Browse the repository at this point in the history
arrays are mutable refs so a new array must be constructed
  • Loading branch information
rzblue committed Oct 24, 2024
1 parent 7ccf7ec commit 68f4d95
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ public Set<PublishedAlert> getSetForType(AlertType type) {
}

private String[] getStrings(AlertType type) {
// TODO: some optimizations available here- could iterate explicitly and cache the array for
// potential reuse (if size is same, refill array, if nothing has changed, return original
// array)
return getSetForType(type).stream().map(a -> a.text()).toArray(String[]::new);
}

Expand Down

0 comments on commit 68f4d95

Please sign in to comment.