diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-20 19:26:52 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-20 19:26:52 -0200 |
commit | 42754c0f15ded97342d3aa67f719e1962fab702a (patch) | |
tree | 5d90865c6b16474307aeba155550184ad12df5a6 /lapi.c | |
parent | 18afb90349fc1b698d179e29fdc014589c2e1145 (diff) | |
download | lua-42754c0f15ded97342d3aa67f719e1962fab702a.tar.gz lua-42754c0f15ded97342d3aa67f719e1962fab702a.tar.bz2 lua-42754c0f15ded97342d3aa67f719e1962fab702a.zip |
small optimizations
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -104,7 +104,9 @@ LUA_API void lua_settop (lua_State *L, int index) { | |||
104 | lua_lock(L); | 104 | lua_lock(L); |
105 | if (index >= 0) { | 105 | if (index >= 0) { |
106 | api_check(L, index <= L->stack_last - L->ci->base); | 106 | api_check(L, index <= L->stack_last - L->ci->base); |
107 | luaD_adjusttop(L, L->ci->base+index); | 107 | while (L->top < L->ci->base + index) |
108 | setnilvalue(L->top++); | ||
109 | L->top = L->ci->base + index; | ||
108 | } | 110 | } |
109 | else { | 111 | else { |
110 | api_check(L, -(index+1) <= (L->top - L->ci->base)); | 112 | api_check(L, -(index+1) <= (L->top - L->ci->base)); |