mirror of
https://github.com/lua/lua.git
synced 2026-11-05 15:25:37 +00:00
small optimizations
This commit is contained in:
@@ -104,7 +104,9 @@ LUA_API void lua_settop (lua_State *L, int index) {
|
||||
lua_lock(L);
|
||||
if (index >= 0) {
|
||||
api_check(L, index <= L->stack_last - L->ci->base);
|
||||
luaD_adjusttop(L, L->ci->base+index);
|
||||
while (L->top < L->ci->base + index)
|
||||
setnilvalue(L->top++);
|
||||
L->top = L->ci->base + index;
|
||||
}
|
||||
else {
|
||||
api_check(L, -(index+1) <= (L->top - L->ci->base));
|
||||
|
||||
Reference in New Issue
Block a user