Skip to content

Commit a7702d0

Browse files
kytpbsKangarooKoala
andcommitted
remove iterator as we don't need it
Co-authored-by: Joseph Eng <[email protected]>
1 parent ede024e commit a7702d0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandScheduler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ public void run() {
264264

265265
boolean isDisabled = RobotState.isDisabled();
266266
// Run scheduled commands, remove finished commands.
267-
for (Iterator<Command> iterator = Set.copyOf(m_scheduledCommands).iterator();
268-
iterator.hasNext(); ) {
269-
Command command = iterator.next();
267+
for (Command command : Set.copyOf(m_scheduledCommands)) {
270268
if (!isScheduled(command)) {
271269
continue; // skip as the normal scheduledCommands was modified and that command was canceled
272270
}

0 commit comments

Comments
 (0)