From 4b6f436d67bd19adcea57f7a2db651b22310bf57 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 12 Feb 2003 07:11:01 -0200 Subject: `unpack' uses `getn' to get table size --- lbaselib.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index ce5e442f..bbb5cb88 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.116 2002/12/20 09:55:56 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.117 2003/02/10 10:21:31 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -295,20 +295,11 @@ static int luaB_assert (lua_State *L) { static int luaB_unpack (lua_State *L) { int n, i; luaL_checktype(L, 1, LUA_TTABLE); - lua_pushliteral(L, "n"); - lua_rawget(L, 1); - n = (lua_isnumber(L, -1)) ? (int)lua_tonumber(L, -1) : -1; - for (i=0; i