diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-12-29 14:23:32 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-12-29 14:23:32 -0200 |
commit | bfdcbbcd76c7187022fe2d35675de0b1c92eeadf (patch) | |
tree | e312b2b1d54e4854693c2e410fb6f0f9bd37c84d /lstrlib.c | |
parent | 30eebb2d1cc2cdd14426b9e80a9e1c576b955f6b (diff) | |
download | lua-bfdcbbcd76c7187022fe2d35675de0b1c92eeadf.tar.gz lua-bfdcbbcd76c7187022fe2d35675de0b1c92eeadf.tar.bz2 lua-bfdcbbcd76c7187022fe2d35675de0b1c92eeadf.zip |
small optimizations (lua_newtable -> lua_createtable)
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.128 2005/12/15 18:53:34 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.129 2005/12/21 12:59:43 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -837,7 +837,7 @@ static const luaL_Reg strlib[] = { | |||
837 | 837 | ||
838 | 838 | ||
839 | static void createmetatable (lua_State *L) { | 839 | static void createmetatable (lua_State *L) { |
840 | lua_newtable(L); /* create metatable for strings */ | 840 | lua_createtable(L, 0, 1); /* create metatable for strings */ |
841 | lua_pushliteral(L, ""); /* dummy string */ | 841 | lua_pushliteral(L, ""); /* dummy string */ |
842 | lua_pushvalue(L, -2); | 842 | lua_pushvalue(L, -2); |
843 | lua_setmetatable(L, -2); /* set string metatable */ | 843 | lua_setmetatable(L, -2); /* set string metatable */ |