lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject BitDocSet code oddity
Date Fri, 14 Nov 2008 18:58:56 GMT
Maybe for the future? Wondering, because it looks odd at the moment - 
OpenBitSet doesn't extend DocSet, so the if can never be true. Something 
seems odd anyway - or maybe its just waiting for future code changes...

public DocSet andNot(DocSet other) {
    OpenBitSet newbits = (OpenBitSet)(bits.clone());
     if (other instanceof OpenBitSet) {
       newbits.andNot(((BitDocSet)other).bits);
     } else {
       DocIterator iter = other.iterator();
       while (iter.hasNext()) newbits.clear(iter.nextDoc());
     }
     return new BitDocSet(newbits);
  }

Mime
View raw message