mirror of https://github.com/apache/lucene.git
SOLR-1965: use fastGet in BitDocSet to speed up intersection counts
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@956110 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6f6dd9763e
commit
cda18f0bd6
|
@ -140,8 +140,11 @@ public class BitDocSet extends DocSetBase {
|
|||
size=-1;
|
||||
}
|
||||
|
||||
/** Returns true of the doc exists in the set.
|
||||
* Should only be called when doc < OpenBitSet.size()
|
||||
*/
|
||||
public boolean exists(int doc) {
|
||||
return bits.get(doc);
|
||||
return bits.fastGet(doc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -108,7 +108,7 @@ public class TestDocSet extends TestCase {
|
|||
}
|
||||
|
||||
public void checkEqual(OpenBitSet bs, DocSet set) {
|
||||
for (int i=0; i<bs.capacity(); i++) {
|
||||
for (int i=0; i<set.size(); i++) {
|
||||
assertEquals(bs.get(i), set.exists(i));
|
||||
}
|
||||
assertEquals(bs.cardinality(), set.size());
|
||||
|
|
Loading…
Reference in New Issue