From a3e1c40d6d6fb81db9d8b58aee69466f715aab5c Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 16 Aug 2012 14:34:28 -0300 Subject: remove of unecessary luaD_checkstack. (In some cases, C should ensure stack space; in others, Lua can use the extra slots for temporary values.) --- lcode.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index 3c39d0ce..16f5702a 100644 --- a/lcode.c +++ b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.60 2011/08/30 16:26:41 roberto Exp roberto $ +** $Id: lcode.c,v 2.61 2012/08/14 18:12:34 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -330,10 +330,9 @@ int luaK_numberK (FuncState *fs, lua_Number r) { setnvalue(&o, r); if (r == 0 || luai_numisnan(NULL, r)) { /* handle -0 and NaN */ /* use raw representation as key to avoid numeric problems */ - setsvalue(L, L->top, luaS_newlstr(L, (char *)&r, sizeof(r))); - incr_top(L); - n = addk(fs, L->top - 1, &o); - L->top--; + setsvalue(L, L->top++, luaS_newlstr(L, (char *)&r, sizeof(r))); + n = addk(fs, L->top - 1, &o); + L->top--; } else n = addk(fs, &o, &o); /* regular case */ -- cgit v1.2.3-55-g6feb