summaryrefslogtreecommitdiff
path: root/ldblib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-12-29 14:23:32 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-12-29 14:23:32 -0200
commitbfdcbbcd76c7187022fe2d35675de0b1c92eeadf (patch)
treee312b2b1d54e4854693c2e410fb6f0f9bd37c84d /ldblib.c
parent30eebb2d1cc2cdd14426b9e80a9e1c576b955f6b (diff)
downloadlua-bfdcbbcd76c7187022fe2d35675de0b1c92eeadf.tar.gz
lua-bfdcbbcd76c7187022fe2d35675de0b1c92eeadf.tar.bz2
lua-bfdcbbcd76c7187022fe2d35675de0b1c92eeadf.zip
small optimizations (lua_newtable -> lua_createtable)
Diffstat (limited to 'ldblib.c')
-rw-r--r--ldblib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ldblib.c b/ldblib.c
index cd2dc75d..6a07237b 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.102 2005/10/19 13:05:11 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.103 2005/11/01 16:08:32 roberto Exp roberto $
3** Interface from Lua to its debug API 3** Interface from Lua to its debug API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -116,7 +116,7 @@ static int db_getinfo (lua_State *L) {
116 return luaL_argerror(L, arg+1, "function or level expected"); 116 return luaL_argerror(L, arg+1, "function or level expected");
117 if (!lua_getinfo(L1, options, &ar)) 117 if (!lua_getinfo(L1, options, &ar))
118 return luaL_argerror(L, arg+2, "invalid option"); 118 return luaL_argerror(L, arg+2, "invalid option");
119 lua_newtable(L); 119 lua_createtable(L, 0, 2);
120 if (strchr(options, 'S')) { 120 if (strchr(options, 'S')) {
121 settabss(L, "source", ar.source); 121 settabss(L, "source", ar.source);
122 settabss(L, "short_src", ar.short_src); 122 settabss(L, "short_src", ar.short_src);
@@ -246,7 +246,7 @@ static void gethooktable (lua_State *L) {
246 lua_rawget(L, LUA_REGISTRYINDEX); 246 lua_rawget(L, LUA_REGISTRYINDEX);
247 if (!lua_istable(L, -1)) { 247 if (!lua_istable(L, -1)) {
248 lua_pop(L, 1); 248 lua_pop(L, 1);
249 lua_newtable(L); 249 lua_createtable(L, 0, 1);
250 lua_pushlightuserdata(L, (void *)&KEY_HOOK); 250 lua_pushlightuserdata(L, (void *)&KEY_HOOK);
251 lua_pushvalue(L, -2); 251 lua_pushvalue(L, -2);
252 lua_rawset(L, LUA_REGISTRYINDEX); 252 lua_rawset(L, LUA_REGISTRYINDEX);