Skip to content

Commit cdb38ad

Browse files
GH-4847 Comment why the ArrayBindingSet iterator does not keep on advancing on hasNext, only skipping non set values
Signed-off-by: Jerven Bolleman <jerven.bolleman@sib.swiss>
1 parent ad5d46a commit cdb38ad

File tree

1 file changed

+3
-2
lines changed
  • core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation

1 file changed

+3
-2
lines changed

core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ArrayBindingSet.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ public ArrayBindingSetIterator() {
331331

332332
@Override
333333
public boolean hasNext() {
334-
for (int at = index; at < values.length; at++) {
335-
if (whichBindingsHaveBeenSet[at] && values[at] != null) {
334+
// If the current index is at at a set value then this wont advance again.
335+
for (; index < values.length; index++) {
336+
if (whichBindingsHaveBeenSet[index] && values[index] != null) {
336337
return true;
337338
}
338339
}

0 commit comments

Comments
 (0)