(index) Optimize ranking calculations

This commit is contained in:
Viktor Lofgren 2024-08-25 11:56:11 +02:00
parent aa2c960b74
commit 3fb3c0b92e

View File

@ -18,7 +18,7 @@ public class DocumentSpan {
}
public boolean intersects(IntIterator positionsIter) {
if (null == startsEnds) {
if (null == startsEnds || !positionsIter.hasNext()) {
return false;
}
@ -26,7 +26,7 @@ public class DocumentSpan {
int start = -1;
int end = -1;
while (iter.hasNext()) {
while (iter.hasNext() && positionsIter.hasNext()) {
if (start < 0) {
start = iter.nextInt();
end = iter.nextInt();