diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java index b9aa08f94b6..96563332826 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java @@ -418,7 +418,7 @@ public ParallelRaceGroup repeatedly(int repetitions) { // use an array so that it stays in the heap instead of stack. // We use an array with a size of 1 instead of `AtomicInteger` because of the performance // overhead - int[] counter = new int[1]; + int[] counter = {0}; return this.finallyDo(() -> counter[0]++).repeatedly().until(() -> counter[0] >= repetitions); }