Skip to content

Commit f31b58c

Browse files
kytpbsKangarooKoala
andcommitted
More explicitly set initial counter value
Co-authored-by: Joseph Eng <[email protected]>
1 parent 9fec4bc commit f31b58c

File tree

1 file changed

+1
-1
lines changed
  • wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public ParallelRaceGroup repeatedly(int repetitions) {
418418
// use an array so that it stays in the heap instead of stack.
419419
// We use an array with a size of 1 instead of `AtomicInteger` because of the performance
420420
// overhead
421-
int[] counter = new int[1];
421+
int[] counter = {0};
422422
return this.finallyDo(() -> counter[0]++).repeatedly().until(() -> counter[0] >= repetitions);
423423
}
424424

0 commit comments

Comments
 (0)