Re: Possible optimization in StringLatin1.regionMatchesCI

2020-05-26 Thread Claes Redestad
So to try and clarify: if (Character.toLowerCase(u1) == Character.toLowerCase(u2)) ... can never happen today in the context of the StringLatin1 version of regionMatchesCI (I did a quick check), and a test that exhaustively tests this property holds should ensure any future unicode updates doesn

Re: Possible optimization in StringLatin1.regionMatchesCI

2020-05-26 Thread Martin Buchholz
On Tue, May 26, 2020 at 4:07 AM Christoph Dreis wrote: > > Hi Martin, > > > Not a review, but: > > Compare with the variant of this code in StringUTF16. > > StringLatin1 only ever needs to support the first 256 chars in Unicode > > Does it really? That makes me wonder even more about the addition

Re: Possible optimization in StringLatin1.regionMatchesCI

2020-05-26 Thread Christoph Dreis
Hi Martin, > Not a review, but: > Compare with the variant of this code in StringUTF16. > StringLatin1 only ever needs to support the first 256 chars in Unicode Does it really? That makes me wonder even more about the additional lowercase check. > which can never change, unlike StringUTF16, W

Re: Possible optimization in StringLatin1.regionMatchesCI

2020-05-25 Thread Martin Buchholz
Not a review, but: Compare with the variant of this code in StringUTF16. StringLatin1 only ever needs to support the first 256 chars in Unicode which can never change, unlike StringUTF16, Do all the String tests still pass if you simplify the code? Should CharacterDataLatin1 have a method to compar

Possible optimization in StringLatin1.regionMatchesCI

2020-05-25 Thread Christoph Dreis
Hi, I've recently looked through the StringLatin1 code - specifically regionMatchesCI. I think I have an optimization, but would need someone with more domain knowledge to verify if I'm missing nothing. Currently, the code does a conversion to uppercase and if that doesn't match it does an ad