lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <ysee...@gmail.com>
Subject Re: (byte)((i & 0x7f) | 0x80) == (byte)(i | 0x80)
Date Wed, 26 Apr 2006 17:49:38 GMT
On 4/26/06, Charlie <charliecmo@gmail.com> wrote:
>    writeByte((byte)((i & 0x7f) | 0x80));
>    writeByte((byte)(i | 0x80));

Yes, these two lines are equivalent.
It's fairly likely that the JVM already does this optimization for you though...
at least gcc -O already compiles to identical assembly for those two lines.

-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server

---------------------------------------------------------------------
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