eris: table nodes now have room to store sequence number
This commit is contained in:
@@ -1141,7 +1141,6 @@ LUA_API int lua_error (lua_State *L) {
|
||||
return 0; /* to avoid warnings */
|
||||
}
|
||||
|
||||
|
||||
LUA_API int lua_next (lua_State *L, int idx) {
|
||||
StkId t;
|
||||
int more;
|
||||
@@ -1158,6 +1157,29 @@ LUA_API int lua_next (lua_State *L, int idx) {
|
||||
return more;
|
||||
}
|
||||
|
||||
LUA_API int lua_nkeys (lua_State *L, int idx) {
|
||||
StkId t;
|
||||
lua_lock(L);
|
||||
t = index2addr(L, idx);
|
||||
api_check(L, ttistable(t), "table expected");
|
||||
int n = luaH_nkeys(hvalue(t));
|
||||
lua_unlock(L);
|
||||
return n;
|
||||
}
|
||||
|
||||
LUA_API int lua_nthkey (lua_State *L, int idx, int n) {
|
||||
StkId t;
|
||||
lua_lock(L);
|
||||
t = index2addr(L, idx);
|
||||
api_check(L, ttistable(t), "table expected");
|
||||
api_incr_top(L);
|
||||
api_incr_top(L);
|
||||
int res = luaH_nthkey(L, hvalue(t), n, L->top - 2);
|
||||
if (res == 0)
|
||||
L->top -= 2;
|
||||
lua_unlock(L);
|
||||
return res;
|
||||
}
|
||||
|
||||
LUA_API void lua_concat (lua_State *L, int n) {
|
||||
lua_lock(L);
|
||||
|
||||
Reference in New Issue
Block a user