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 <[email protected]>
  • Loading branch information
kytpbs and KangarooKoala committed Oct 10, 2024
1 parent fcc7b8d commit 1422622
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 1422622

Please sign in to comment.