RFR: JDK-8032012, , String.toLowerCase/toUpperCase performance improvement
Ulf Zibis
Ulf.Zibis at CoSoCo.de
Thu Feb 6 18:30:42 UTC 2014
Am 06.02.2014 18:40, schrieb Xueming Shen:
> Ulf,
>
> webrev has been updated to use isBmpCodePoint() as suggested. Another
> benefit of using isBmpCodePoint() is that some Character.ERROR checks
> are no longer necessary
Great, I didn't see that.
But why not just coding:
2558 char ch = value[first];
2559 if (Character.isSurrogate(ch) {
2560 hasSurr = true;
2561 break;
2562 }
2563 if (ch != Character.toLowerCase((int)ch)) { // no need to check Character.ERROR
2564 break;
2565 }
-Ulf
More information about the core-libs-dev
mailing list