aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-20 19:26:52 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-20 19:26:52 -0200
commit42754c0f15ded97342d3aa67f719e1962fab702a (patch)
tree5d90865c6b16474307aeba155550184ad12df5a6 /lapi.c
parent18afb90349fc1b698d179e29fdc014589c2e1145 (diff)
downloadlua-42754c0f15ded97342d3aa67f719e1962fab702a.tar.gz
lua-42754c0f15ded97342d3aa67f719e1962fab702a.tar.bz2
lua-42754c0f15ded97342d3aa67f719e1962fab702a.zip
small optimizations
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 07f2cfb2..30e4d268 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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));