mirror of https://github.com/apache/lucene.git
LUCENE-1614: if a DISI doesn't implement advance, emulate it using skipTo
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@794399 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
229a0a84a1
commit
d7579b7e1e
|
@ -142,8 +142,10 @@ public abstract class DocIdSetIterator {
|
|||
* @since 2.9
|
||||
*/
|
||||
public int advance(int target) throws IOException {
|
||||
while (nextDoc() < target) {}
|
||||
return doc;
|
||||
if (target == NO_MORE_DOCS) {
|
||||
return doc = NO_MORE_DOCS;
|
||||
}
|
||||
return doc = skipTo(target) ? doc() : NO_MORE_DOCS;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue