On Tue, Mar 16, 2010 at 12:48, Ulf Zibis <[email protected]> wrote: > Here my additions: > > Am 13.03.2010 00:04, schrieb Martin Buchholz: >>> >>> - Why don't you like using the new isBMPCodePoint() for >>> isSupplementaryCodePoint() and toUpperCaseCharArray() ? >>> >> >> I now use it for the assert in toUpperCaseCharArray() >> > > return !isBMPCodePoint() && isValidCodePoint(); > resolves in same than current code.
Hmmmm...... Yes, you've convinced me! Done. >>> - Same shift magic would enhance isISOControl(), isHighSurrogate(), >>> isLowSurrogate(), in particular if latter occur consecutive. >>> >> >> isISOControl - yes, others - I am not convinced. >> > > If virtually shifted by 8, HotSpot could use cheaper 1-byte compare on the > high byte. > Additionally, those methods are often used consecutively, so all 4 compares > would benefit from. Sorry, I'm still not convinced for the surrogate testing methods. Almost all chars are less than MIN_SURROGATE, so you have to beat the already amazingly cheap x >= MIN_SURROGATE. Martin
