Skip to content

Commit

Permalink
In OrIterator.next(), only use candidateSet.first() as possible yield…
Browse files Browse the repository at this point in the history
…Key if !contextRequired()
  • Loading branch information
billoley committed Feb 1, 2024
1 parent 610d637 commit 4642b5b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,12 @@ public T next() {
}
}
} catch (WaitWindowOverrunException e) {
// if prev != null then it's a match that has not been returned
Key possibleYieldKey = null;
if (prev != null || !candidateSet.isEmpty()) {
possibleYieldKey = (prev != null) ? (Key) prev : (Key) candidateSet.first();
if (prev != null) {
// if prev != null then it's a match that has not been returned
possibleYieldKey = (Key) prev;
} else if (!isContextRequired() && !candidateSet.isEmpty()) {
possibleYieldKey = (Key) candidateSet.first();
}
// When comparing possible yield keys in the OrIterator, we choose the lowest
// key because a match in any sources can return a match
Expand Down

0 comments on commit 4642b5b

Please sign in to comment.