optimize next

This commit is contained in:
wenshao 2025-03-07 20:02:47 +08:00
parent 94bc5d1f04
commit d4f3b141ce
2 changed files with 2 additions and 2 deletions

View File

@ -3355,7 +3355,7 @@ final class JSONReaderUTF16
}
public static int next(JSONReaderUTF16 jsonReader, char[] bytes, int offset, int end) {
int ch = offset >= end ? EOI : bytes[offset++];
int ch = offset == end ? EOI : bytes[offset++];
while (ch == '\0' || (ch <= ' ' && ((1L << ch) & SPACE) != 0)) {
ch = offset == end ? EOI : bytes[offset++];
}

View File

@ -4490,7 +4490,7 @@ class JSONReaderUTF8
}
public static int next(JSONReaderUTF8 jsonReader, byte[] bytes, int offset, int end) {
int ch = offset >= end ? EOI : bytes[offset++];
int ch = offset == end ? EOI : bytes[offset++];
while (ch == '\0' || (ch <= ' ' && ((1L << ch) & SPACE) != 0)) {
ch = offset == end ? EOI : bytes[offset++];
}