From d766e2ae175495da85714d00e61d76174c5acc5b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 25 Feb 2018 09:48:16 -0300 Subject: first (parcial) implementation of 'keyin'/'removekey' (still no metamethods, no raw verssions) --- ltablib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ltablib.c') diff --git a/ltablib.c b/ltablib.c index 588bf40d..982821ed 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.92 2016/02/08 12:55:19 roberto Exp roberto $ +** $Id: ltablib.c,v 1.93 2016/02/25 19:41:54 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -113,8 +113,8 @@ static int tremove (lua_State *L) { lua_geti(L, 1, pos + 1); lua_seti(L, 1, pos); /* t[pos] = t[pos + 1] */ } - lua_pushnil(L); - lua_seti(L, 1, pos); /* t[pos] = nil */ + lua_pushinteger(L, pos); + lua_removekey(L, 1); /* remove entry t[pos] */ return 1; } -- cgit v1.2.3-55-g6feb