diff options
author | Mike Pall <mike> | 2012-08-25 23:02:29 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-08-25 23:02:29 +0200 |
commit | 4c882fe71406a923f07c8e9a0b9189036e0ba386 (patch) | |
tree | 22aa3995b5bdc2fce05ba17488799e67abc635ba /src/lib_base.c | |
parent | 653facd0d5c1a4f7eae43eefbf8148f57e28e606 (diff) | |
download | luajit2-4c882fe71406a923f07c8e9a0b9189036e0ba386.tar.gz |
Replace strtod() with builtin string to number conversion.
Diffstat (limited to 'src/lib_base.c')
-rw-r--r-- | src/lib_base.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib_base.c b/src/lib_base.c index 383955d4..9702c5b4 100644 --- a/src/lib_base.c +++ b/src/lib_base.c @@ -31,6 +31,7 @@ #include "lj_ff.h" #include "lj_dispatch.h" #include "lj_char.h" +#include "lj_strscan.h" #include "lj_lib.h" /* -- Base library: checks ------------------------------------------------ */ @@ -191,7 +192,7 @@ LJLIB_ASM(tonumber) LJLIB_REC(.) int32_t base = lj_lib_optint(L, 2, 10); if (base == 10) { TValue *o = lj_lib_checkany(L, 1); - if (tvisnumber(o) || (tvisstr(o) && lj_str_tonumber(strV(o), o))) { + if (lj_strscan_numberobj(o)) { copyTV(L, L->base-1, o); return FFH_RES(1); } |