Skip to content

Commit

Permalink
GH-4847 Comment why the ArrayBindingSet iterator does not keep on adv…
Browse files Browse the repository at this point in the history
…ancing on hasNext, only skipping non set values

Signed-off-by: Jerven Bolleman <[email protected]>
  • Loading branch information
JervenBolleman committed Nov 22, 2023
1 parent ad5d46a commit cdb38ad
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,9 @@ public ArrayBindingSetIterator() {

@Override
public boolean hasNext() {
for (int at = index; at < values.length; at++) {
if (whichBindingsHaveBeenSet[at] && values[at] != null) {
// If the current index is at at a set value then this wont advance again.
for (; index < values.length; index++) {
if (whichBindingsHaveBeenSet[index] && values[index] != null) {
return true;
}
}
Expand Down

0 comments on commit cdb38ad

Please sign in to comment.