Peculiar fruits in the JDK
forax at univ-mlv.fr
Thu Jun 26 03:31:46 PDT 2008
Ulf Zibis a écrit :
> Also I've found out, that MASK1 is superfluous, because on implicit
> converting from char to int all upper bits are automaticlly 0.
No, all upper bits are the value of the sign bit, you can remove the
mask only if
you use unsigned values.
> So we can code instead:
> char c = c2bMap.charAt(c2bMapIndex[current >> SHIFT] +
> (current & MASK));
> char c = (current < '\u0100') ? c2bMap.charAt(current) :
> c2bMap.charAt(c2bMapIndex[current >> SHIFT] + (current &
More information about the core-libs-dev