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->pop();
|
||||
self->numDfa.reset();
|
||||
buf = (char *)self->numDfa.scan(buf, bufEnd);
|
||||
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);
|
||||
case 't':
|
||||
++buf;
|
||||
|
||||
Reference in New Issue
Block a user