Optimize and refactor printing of numbers to buffers.

This commit is contained in:
Mike Pall
2013-03-25 16:41:13 +01:00
parent 3b0b3afbb1
commit 59329cfbbf
5 changed files with 70 additions and 63 deletions

View File

@@ -79,10 +79,7 @@ static GCstr *argv2str(jit_State *J, TValue *o)
GCstr *s;
if (!tvisnumber(o))
lj_trace_err(J, LJ_TRERR_BADTYPE);
if (tvisint(o))
s = lj_str_fromint(J->L, intV(o));
else
s = lj_str_fromnum(J->L, &o->n);
s = lj_str_fromnumber(J->L, o);
setstrV(J->L, o, s);
return s;
}