Skip to content

Commit

Permalink
remove iterator as we don't need it
Browse files Browse the repository at this point in the history
Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
  • Loading branch information
kytpbs and KangarooKoala authored May 21, 2024
1 parent a756ff5 commit 924169b
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ public void run() {

boolean isDisabled = RobotState.isDisabled();
// Run scheduled commands, remove finished commands.
for (Iterator<Command> iterator = Set.copyOf(m_scheduledCommands).iterator();
iterator.hasNext(); ) {
Command command = iterator.next();
for (Command command : Set.copyOf(m_scheduledCommands)) {
if (!isScheduled(command)) {
continue; // skip as the normal scheduledCommands was modified and that command was canceled
}
Expand Down

0 comments on commit 924169b

Please sign in to comment.