diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-04-04 11:23:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-04-04 11:23:41 -0300 |
commit | 03c6a05ec836c3a90a6b8d730120afdad39c092b (patch) | |
tree | 31f0bdf82969b1e082e92d7b5dd5d9e1496d64af /ltablib.c | |
parent | 3d0b5edfe4df7ec54d6885b6b6ce917faddf6661 (diff) | |
download | lua-03c6a05ec836c3a90a6b8d730120afdad39c092b.tar.gz lua-03c6a05ec836c3a90a6b8d730120afdad39c092b.tar.bz2 lua-03c6a05ec836c3a90a6b8d730120afdad39c092b.zip |
no more nil-in-table
Diffstat (limited to 'ltablib.c')
-rw-r--r-- | ltablib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltablib.c,v 1.95 2018/02/27 18:47:32 roberto Exp roberto $ | 2 | ** $Id: ltablib.c,v 1.96 2018/03/16 14:18:18 roberto Exp roberto $ |
3 | ** Library for Table Manipulation | 3 | ** Library for Table Manipulation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -95,8 +95,8 @@ static int tremove (lua_State *L) { | |||
95 | lua_geti(L, 1, pos + 1); | 95 | lua_geti(L, 1, pos + 1); |
96 | lua_seti(L, 1, pos); /* t[pos] = t[pos + 1] */ | 96 | lua_seti(L, 1, pos); /* t[pos] = t[pos + 1] */ |
97 | } | 97 | } |
98 | lua_pushinteger(L, pos); | 98 | lua_pushnil(L); |
99 | lua_removekey(L, 1); /* remove entry t[pos] */ | 99 | lua_seti(L, 1, pos); /* remove entry t[pos] */ |
100 | return 1; | 100 | return 1; |
101 | } | 101 | } |
102 | 102 | ||