mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
2a7c200dc2
@ -492,12 +492,11 @@ StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt)
|
||||
/* Fast path for decimal 32 bit integers. */
|
||||
if (fmt == STRSCAN_INT && base == 10 &&
|
||||
(dig < 10 || (dig == 10 && *sp <= '2' && x < 0x80000000u+neg))) {
|
||||
int32_t y = neg ? -(int32_t)x : (int32_t)x;
|
||||
if ((opt & STRSCAN_OPT_TONUM)) {
|
||||
o->n = (double)y;
|
||||
o->n = neg ? -(double)x : (double)x;
|
||||
return STRSCAN_NUM;
|
||||
} else {
|
||||
o->i = y;
|
||||
o->i = neg ? -(int32_t)x : (int32_t)x;
|
||||
return STRSCAN_INT;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user