mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8280124: Reduce branches decoding latin-1 chars from UTF-8 encoded bytes
Reviewed-by: rriggs, alanb, naoto
This commit is contained in:
parent
bdfa15d92c
commit
e314a4cfda
2 changed files with 105 additions and 46 deletions
|
@ -541,8 +541,7 @@ public final class String
|
|||
offset++;
|
||||
continue;
|
||||
}
|
||||
if ((b1 == (byte)0xc2 || b1 == (byte)0xc3) &&
|
||||
offset + 1 < sl) {
|
||||
if ((b1 & 0xfe) == 0xc2 && offset + 1 < sl) { // b1 either 0xc2 or 0xc3
|
||||
int b2 = bytes[offset + 1];
|
||||
if (!isNotContinuation(b2)) {
|
||||
dst[dp++] = (byte)decode2(b1, b2);
|
||||
|
@ -698,8 +697,7 @@ public final class String
|
|||
offset++;
|
||||
continue;
|
||||
}
|
||||
if ((b1 == (byte) 0xc2 || b1 == (byte) 0xc3) &&
|
||||
offset + 1 < sl) {
|
||||
if ((b1 & 0xfe) == 0xc2 && offset + 1 < sl) { // b1 either 0xc2 or 0xc3
|
||||
int b2 = bytes[offset + 1];
|
||||
if (!isNotContinuation(b2)) {
|
||||
dst[dp++] = (byte) decode2(b1, b2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue