From 03c6a05ec836c3a90a6b8d730120afdad39c092b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 4 Apr 2018 11:23:41 -0300 Subject: no more nil-in-table --- ltablib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ltablib.c') diff --git a/ltablib.c b/ltablib.c index 5a78c15b..7bbc3a07 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.95 2018/02/27 18:47:32 roberto Exp roberto $ +** $Id: ltablib.c,v 1.96 2018/03/16 14:18:18 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -95,8 +95,8 @@ static int tremove (lua_State *L) { lua_geti(L, 1, pos + 1); lua_seti(L, 1, pos); /* t[pos] = t[pos + 1] */ } - lua_pushinteger(L, pos); - lua_removekey(L, 1); /* remove entry t[pos] */ + lua_pushnil(L); + lua_seti(L, 1, pos); /* remove entry t[pos] */ return 1; } -- cgit v1.2.3-55-g6feb