A DESCRIPTION OF THE PROBLEM :
some thoughts after watchingJDK-8285001: Simplify StringLatin1.regionMatches
if (Character.toLowerCase(u1) == Character.toLowerCase(u2)) {
continue;
}
should be changed to
if (((u1 == c1) ? CharacterDataLatin1.instance.toLowerCase(c1) : c1) == Character.toLowerCase(u2)) {
continue;
}
as:
1. c1 is LATIN1, so CharacterDataLatin1.instance.toLowerCase seems faster.
2. because c1 is LATIN1, so if u1 != c1, then c1 is already lowercase, and don't need a lowercase cauculation.
some thoughts after watching
if (Character.toLowerCase(u1) == Character.toLowerCase(u2)) {
continue;
}
should be changed to
if (((u1 == c1) ? CharacterDataLatin1.instance.toLowerCase(c1) : c1) == Character.toLowerCase(u2)) {
continue;
}
as:
1. c1 is LATIN1, so CharacterDataLatin1.instance.toLowerCase seems faster.
2. because c1 is LATIN1, so if u1 != c1, then c1 is already lowercase, and don't need a lowercase cauculation.
- relates to
-
JDK-8285001 Simplify StringLatin1.regionMatches
- Resolved
- links to
-
Review openjdk/jdk/8308