Rewrite of IBM doublebyte charsets

Xueming Shen Xueming.Shen at Sun.COM
Tue May 12 19:03:01 UTC 2009


Ulf Zibis wrote:
>>>
>>> *** Question: Why you code:
>>>
>>>                   } else if ((byte1 & MSB) == 0) {  // ASCII  G0
>>>
>>> instead of:
>>>
>>>                   } else if (byte1 >= 0) {  // ASCII  G0
>>>
>> I believe this line was written 10 years ago, so I have no idea (or 
>> forgot) why we picked this one, my guess is the code might
>> be a little easier to read with "MSB"...you think the >=0 is better 
>> or faster/
>
> Yes, I think it's also faster, as loading of "MSB" + AND would be saved.
> Not sure if HotSpot will detect the shortcut!
>

it actually should be "byte1 < 0x80"

>
>




More information about the core-libs-dev mailing list