From 292c9530183a8e9939cff9a7d30fc50e85031698 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 5 Jun 2000 17:15:33 -0300 Subject: new auxiliar function `luaH_setstr' --- lbuiltin.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lbuiltin.c') diff --git a/lbuiltin.c b/lbuiltin.c index 2e5833ed..19cdb6d6 100644 --- a/lbuiltin.c +++ b/lbuiltin.c @@ -1,5 +1,5 @@ /* -** $Id: lbuiltin.c,v 1.111 2000/05/26 19:17:57 roberto Exp roberto $ +** $Id: lbuiltin.c,v 1.112 2000/06/02 19:08:56 roberto Exp roberto $ ** Built-in functions ** See Copyright Notice in lua.h */ @@ -68,12 +68,7 @@ static Number getsize (const Hash *h) { static Number getnarg (lua_State *L, const Hash *a) { - TObject index; - const TObject *value; - /* value = table.n */ - ttype(&index) = TAG_STRING; - tsvalue(&index) = luaS_new(L, "n"); - value = luaH_get(L, a, &index); + const TObject *value = luaH_getstr(a, luaS_new(L, "n")); /* value = a.n */ return (ttype(value) == TAG_NUMBER) ? nvalue(value) : getsize(a); } -- cgit v1.2.3-55-g6feb