On Wed, 22 Feb 2023 16:10:42 GMT, Martin Buchholz <mar...@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

Reply via email to