Avoid pushing N_NUMBER on the stack if possible
This commit is contained in:
@@ -508,9 +508,18 @@ inline PRESERVE_NONE WeaselJsonStatus n_value(Parser3 *self, char *buf,
|
|||||||
self->dataBegin = buf;
|
self->dataBegin = buf;
|
||||||
self->pop();
|
self->pop();
|
||||||
self->numDfa.reset();
|
self->numDfa.reset();
|
||||||
if (auto s = self->push({N_NUMBER})) {
|
buf = (char *)self->numDfa.scan(buf, bufEnd);
|
||||||
return s;
|
if (buf == bufEnd) {
|
||||||
|
self->flushNumber(false, buf);
|
||||||
|
if (auto s = self->push({N_NUMBER})) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
return WeaselJson_AGAIN;
|
||||||
}
|
}
|
||||||
|
if (!self->numDfa.accept()) [[unlikely]] {
|
||||||
|
return WeaselJson_REJECT;
|
||||||
|
}
|
||||||
|
self->flushNumber(true, buf);
|
||||||
MUSTTAIL return Parser3::keepGoing(self, buf, bufEnd);
|
MUSTTAIL return Parser3::keepGoing(self, buf, bufEnd);
|
||||||
case 't':
|
case 't':
|
||||||
++buf;
|
++buf;
|
||||||
|
|||||||
Reference in New Issue
Block a user