<i18n dev> RFR: 8302871: Speed up StringLatin1.regionMatchesCI [v7]
Eirik Bjorsnos
duke at openjdk.org
Wed Feb 22 16:33:43 UTC 2023
On Wed, 22 Feb 2023 16:10:42 GMT, Martin Buchholz <martin at openjdk.org> wrote:
>> Thanks Martin, David, Alan. This was instructive (and fun!)
>>
>> I suggest we condense the comment to something like this:
>>
>>
>> // Uppercase b1 by removing a single bit
>> int upper = b1 & 0xDF;
>> if (upper < 'A') {
>> return false; // Low ASCII
>> }
>> ...
>>
>>
>> The similar methods `toLowerCase` `toUpperCase` just above have been updated to follow the same style. (I also updated local variable names there to align better with equalsIgnoreCase)
>
> // ASCII and Latin-1 were designed to optimize case-twiddling operations
Thanks! This expresses the higher-level benefit succinctly, without getting into the details. I like it!
-------------
PR: https://git.openjdk.org/jdk/pull/12632
More information about the i18n-dev
mailing list