On Wed, Jan 5, 2011 at 2:21 PM, Uwe Schindler <u...@thetaphi.de> wrote: > Some other ideas: > Maybe add an isEmpty() "hint" method to DocIdSet(Iterator). Empty DocIdSet > would always return true. The problem, this method is costly for OpenBitSet. > Maybe its just a "hint". Returning false is also OK when its empty. So if > you have an docIdSet that’s empty and you can easily detect it, simply > return true. The default impl returns false.
Hmm... feels like that's overly complicated? Shouldn't we encourage impls to just use the empty sentinel? > Something else: EMPTY_DOCIDSETITER could be same instance EMPTY_SCORER == > EMPTY_DOCIDSETITER (and implemented as Scorer). You only have to add few > methods to this empty instance. I like this one! Mike --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org