small optimizations (lua_newtable -> lua_createtable)

This commit is contained in:
Roberto Ierusalimschy
2005-12-29 14:23:32 -02:00
parent 30eebb2d1c
commit bfdcbbcd76
9 changed files with 35 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lbaselib.c,v 1.186 2005/10/21 13:47:42 roberto Exp roberto $
** $Id: lbaselib.c,v 1.187 2005/12/27 17:10:11 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -625,7 +625,7 @@ static void base_open (lua_State *L) {
auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
auxopen(L, "pairs", luaB_pairs, luaB_next);
/* `newproxy' needs a weaktable as upvalue */
lua_newtable(L); /* new table `w' */
lua_createtable(L, 0, 1); /* new table `w' */
lua_pushvalue(L, -1); /* `w' will be its own metatable */
lua_setmetatable(L, -2);
lua_pushliteral(L, "kv");