From 86a4de256e88844e34535901d25923aa851d963e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 7 Feb 2002 15:25:36 -0200 Subject: no more lua_[gs]etstr --- lbaselib.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 74d176dd..f1a7b5ab 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -20,8 +20,9 @@ static void aux_setn (lua_State *L, int t, int n) { + lua_pushliteral(L, "n"); lua_pushnumber(L, n); - lua_setstr(L, t, "n"); + lua_rawset(L, t); } @@ -444,7 +445,8 @@ static int luaB_coroutine (lua_State *L) { } lua_cobegin(NL, n-1); lua_newuserdatabox(L, NL); - lua_getstr(L, LUA_REGISTRYINDEX, "Coroutine"); + lua_pushliteral(L, "Coroutine"); + lua_rawget(L, LUA_REGISTRYINDEX); lua_setmetatable(L, -2); lua_pushcclosure(L, luaB_resume, 1); return 1; @@ -700,10 +702,12 @@ LUALIB_API int lua_baselibopen (lua_State *L) { lua_pushcclosure(L, luaB_require, 1); lua_setglobal(L, "require"); /* create metatable for coroutines */ + lua_pushliteral(L, "Coroutine"); lua_newtable(L); + lua_pushliteral(L, "gc"); lua_pushcfunction(L, gc_coroutine); - lua_setstr(L, -2, "gc"); - lua_setstr(L, LUA_REGISTRYINDEX, "Coroutine"); + lua_rawset(L, -3); + lua_rawset(L, LUA_REGISTRYINDEX); return 0; } -- cgit v1.2.3-55-g6feb