Avoid Utf8Dfa scan if there's no non-ascii
This commit is contained in:
@@ -209,6 +209,7 @@ inline PRESERVE_NONE WeaselJsonStatus scan_string_impl(Parser3 *self,
|
|||||||
if (self->strDfa.accept()) {
|
if (self->strDfa.accept()) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (bufEnd - buf < V::lanes) [[unlikely]] {
|
if (bufEnd - buf < V::lanes) [[unlikely]] {
|
||||||
|
buf = (char *)self->strDfa.scan(buf, bufEnd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
auto v = V{(int8_t *)buf};
|
auto v = V{(int8_t *)buf};
|
||||||
@@ -217,13 +218,16 @@ inline PRESERVE_NONE WeaselJsonStatus scan_string_impl(Parser3 *self,
|
|||||||
.count_leading_nonzero_lanes();
|
.count_leading_nonzero_lanes();
|
||||||
buf += normal;
|
buf += normal;
|
||||||
if (normal < V::lanes) {
|
if (normal < V::lanes) {
|
||||||
|
if (buf != bufEnd && *buf < 0x20) {
|
||||||
|
buf = (char *)self->strDfa.scan(buf, bufEnd);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
buf = (char *)self->strDfa.scan(buf, bufEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = (char *)self->strDfa.scan(buf, bufEnd);
|
|
||||||
|
|
||||||
int len = buf - before;
|
int len = buf - before;
|
||||||
if (!(self->flags & WeaselJsonRaw)) {
|
if (!(self->flags & WeaselJsonRaw)) {
|
||||||
if (self->writeBuf != before) {
|
if (self->writeBuf != before) {
|
||||||
|
|||||||
Reference in New Issue
Block a user