Skip to content

Commit

Permalink
More explicitly set initial counter value
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 committed Dec 16, 2024
1 parent 02aed2f commit 57ceb5b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 57ceb5b

Please sign in to comment.