From bfdcbbcd76c7187022fe2d35675de0b1c92eeadf Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 29 Dec 2005 14:23:32 -0200 Subject: small optimizations (lua_newtable -> lua_createtable) --- ldblib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ldblib.c') diff --git a/ldblib.c b/ldblib.c index cd2dc75d..6a07237b 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.102 2005/10/19 13:05:11 roberto Exp roberto $ +** $Id: ldblib.c,v 1.103 2005/11/01 16:08:32 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -116,7 +116,7 @@ static int db_getinfo (lua_State *L) { return luaL_argerror(L, arg+1, "function or level expected"); if (!lua_getinfo(L1, options, &ar)) return luaL_argerror(L, arg+2, "invalid option"); - lua_newtable(L); + lua_createtable(L, 0, 2); if (strchr(options, 'S')) { settabss(L, "source", ar.source); settabss(L, "short_src", ar.short_src); @@ -246,7 +246,7 @@ static void gethooktable (lua_State *L) { lua_rawget(L, LUA_REGISTRYINDEX); if (!lua_istable(L, -1)) { lua_pop(L, 1); - lua_newtable(L); + lua_createtable(L, 0, 1); lua_pushlightuserdata(L, (void *)&KEY_HOOK); lua_pushvalue(L, -2); lua_rawset(L, LUA_REGISTRYINDEX); -- cgit v1.2.3-55-g6feb