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

23
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.289 2018/02/27 17:48:28 roberto Exp roberto $
** $Id: lapi.c,v 2.290 2018/02/27 20:01:55 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -705,27 +705,6 @@ LUA_API int lua_rawgetp (lua_State *L, int idx, const void *p) {
}
static int auxkeydef (lua_State *L, int idx, int remove) {
int res;
lua_lock(L);
api_checknelems(L, 1);
res = luaT_keydef(L, index2value(L, idx), s2v(L->top - 1), remove);
L->top--; /* remove key */
lua_unlock(L);
return res;
}
LUA_API void lua_removekey (lua_State *L, int idx) {
auxkeydef(L, idx, 1);
}
LUA_API int lua_keyin (lua_State *L, int idx) {
return auxkeydef(L, idx, 0);
}
LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
Table *t;
lua_lock(L);