Optimized version of CopiesList.hashCode()

Tagir Valeev amaembo at gmail.com
Mon Dec 3 06:41:47 UTC 2018


Hello, Ivan!

> The check
>      if (((n << i) & 0x8000_0000) != 0) {
> might be written as
>      if ((n << i) < 0 ) {
> to save one bit-wise operation and avoid using extra constant.

Nice catch, thanks! When I switch my mind to bitwise thinking mode, I
forget about normal arithmetic properties like sign :-)
Webrev is posted:
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057038.html

With best regards
Tagir Valeev.


More information about the core-libs-dev mailing list