mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 13:09:00 +00:00
(index) Optimize ranking calculations
This commit is contained in:
parent
aa2c960b74
commit
3fb3c0b92e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user