no more nil-in-table

This commit is contained in:
Roberto Ierusalimschy
2018-04-04 11:23:41 -03:00
parent 3d0b5edfe4
commit 03c6a05ec8
16 changed files with 23 additions and 172 deletions

View File

@@ -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;
}