Skip to content

Commit 2e3b99d

Browse files
committed
fix small RandomQuery's nextDoc optimization to not iterate to doc >= maxDoc
1 parent 27945a2 commit 2e3b99d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/perf/RandomQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public int nextDoc() throws IOException {
5454
int addend = (31 * intervalId) % interval;
5555
int newDoc = intervalId * interval + addend;
5656
assert newDoc > doc;
57-
if (doc >= maxDoc) {
57+
if (newDoc >= maxDoc) {
5858
return doc = NO_MORE_DOCS;
5959
} else {
6060
return doc = newDoc;

0 commit comments

Comments
 (0)