lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Another possible optimization - now in DocIdSetIterator
Date Fri, 24 Apr 2009 21:41:05 GMT
It's a nice approach, but I think it relies on C interpreting integer
0 as false, which we can't do in Java.   (And, we lack "unsigned int"
in java so we have immense freedom to pick any negative number as our
sentinel ;) ).

Not to mention it'd be a scary change to make at this point!  So I
think we should just stick with -1 as our sentinel.

Mike

On Fri, Apr 24, 2009 at 5:33 PM, Marvin Humphrey <marvin@rectangular.com> wrote:
> On Fri, Apr 24, 2009 at 05:18:30PM -0400, Michael McCandless wrote:
>
>> > One additional wrinkle, though: doc nums start at 1 rather than 0, so the
>> > return values for Next() and Advance() can double as a booleans.
>>
>> Meaning they return 0 to indicate "no more docs"?
>
> Yes.  0 is our sentinel.
>
> Marvin Humphrey
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message