Skip to content

Commit 42217bd

Browse files
committed
Fixing iterations to stop at 1 rather than 0
1 parent bd58af9 commit 42217bd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/utils/key/CircularKey.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public String next(long docIndex) {
2929
}
3030

3131
public boolean checkIterations() {
32-
// Can be both -1 (Infinite load) or greater than 1 (iterations set by user)
33-
if (this.iterations != 0) {
32+
// Can be -1 (Infinite load) or >= 1 (iterations set by user)
33+
// Stop when iterations reaches 1 (not 0) since first pass runs
34+
// without calling checkIterations()
35+
if (this.iterations != 1) {
3436
if (this.iterations >= 1)
3537
// Num_iterations set by user, so decrement by one
3638
this.iterations -= 1;

0 commit comments

Comments
 (0)