You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Daniel Naber <da...@t-online.de> on 2004/08/14 17:15:06 UTC

bitwise OR in BooleanScorer

Hi,

BooleanScorer's next() method uses a bitwise OR in a while loop:

...} while (bucketTable.first != null | more);

Is there any reason for this, couldn't this just be || ? BTW, I found this 
with FindBugs (http://findbugs.sourceforge.net/), which takes a jar files 
and gives some useful warnings about potential bugs.

Regards
 Daniel

-- 
http://www.danielnaber.de

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


Re: bitwise OR in BooleanScorer

Posted by Paul Elschot <pa...@xs4all.nl>.
On Saturday 14 August 2004 17:15, Daniel Naber wrote:
> Hi,
>
> BooleanScorer's next() method uses a bitwise OR in a while loop:
>
> ...} while (bucketTable.first != null | more);
>
> Is there any reason for this, couldn't this just be || ? BTW, I found this
> with FindBugs (http://findbugs.sourceforge.net/), which takes a jar files
> and gives some useful warnings about potential bugs.

Both expressions around the | are booleans, so a || would be better style.

Regards,
Paul


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