JSONReaderASCIISlash

This commit is contained in:
wenshao 2025-02-26 05:34:21 +08:00
parent e8e9acb50d
commit 2f6b8bcafe

View File

@ -7191,19 +7191,7 @@ class JSONReaderUTF8
ascii = IOUtils.isASCII(bytes, off, len);
}
if (ascii) {
int slashIndex = JSONReaderASCIISlash.ESCAPE_INDEX_NOT_SET;
if (INDEX_OF_CHAR_LATIN1 != null) {
try {
slashIndex = (int) INDEX_OF_CHAR_LATIN1.invokeExact(bytes, (int) '\\', off, off + len);
} catch (Throwable ignored) {
// ignore
}
}
if (slashIndex == -1) {
return new JSONReaderASCIINonSlash(context, null, bytes, off, len);
} else {
return new JSONReaderASCIISlash(context, null, bytes, off, len, slashIndex);
}
return new JSONReaderASCIISlash(context, null, bytes, off, len, JSONReaderASCIISlash.ESCAPE_INDEX_NOT_SET);
}
return new JSONReaderUTF8(context, bytes, off, len);
}