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 <[email protected]>
  • Loading branch information
kytpbs and KangarooKoala committed Dec 16, 2024
1 parent efe0b17 commit 7be3682
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 7be3682

Please sign in to comment.