mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8302871: Speed up StringLatin1.regionMatchesCI
Reviewed-by: redestad, martin, alanb
This commit is contained in:
parent
b4ea80731c
commit
17e3769ed7
4 changed files with 161 additions and 18 deletions
|
@ -384,14 +384,9 @@ final class StringLatin1 {
|
|||
byte[] other, int ooffset, int len) {
|
||||
int last = toffset + len;
|
||||
while (toffset < last) {
|
||||
char c1 = (char)(value[toffset++] & 0xff);
|
||||
char c2 = (char)(other[ooffset++] & 0xff);
|
||||
if (c1 == c2) {
|
||||
continue;
|
||||
}
|
||||
int u1 = CharacterDataLatin1.instance.toUpperCase(c1);
|
||||
int u2 = CharacterDataLatin1.instance.toUpperCase(c2);
|
||||
if (u1 == u2) {
|
||||
byte b1 = value[toffset++];
|
||||
byte b2 = other[ooffset++];
|
||||
if (CharacterDataLatin1.equalsIgnoreCase(b1, b2)) {
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue