diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-10-14 17:13:31 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-10-14 17:13:31 -0200 |
commit | 4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec (patch) | |
tree | d11eee681ce7b01a273e489f47e070494b51de1a /lapi.c | |
parent | b6ebbb2fee13aa223fdd12921cd0411e02db9dd0 (diff) | |
download | lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.gz lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.bz2 lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.zip |
new implementation of hash tables.
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.52 1999/10/07 19:04:30 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.53 1999/10/11 16:13:11 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -422,11 +422,11 @@ const char *lua_nextvar (const char *varname) { | |||
422 | 422 | ||
423 | 423 | ||
424 | int luaA_next (const Hash *t, int i) { | 424 | int luaA_next (const Hash *t, int i) { |
425 | int tsize = nhash(t); | 425 | int tsize = t->size; |
426 | for (; i<tsize; i++) { | 426 | for (; i<tsize; i++) { |
427 | Node *n = node(t, i); | 427 | Node *n = node(t, i); |
428 | if (ttype(val(n)) != LUA_T_NIL) { | 428 | if (ttype(val(n)) != LUA_T_NIL) { |
429 | luaA_pushobject(ref(n)); | 429 | luaA_pushobject(key(n)); |
430 | luaA_pushobject(val(n)); | 430 | luaA_pushobject(val(n)); |
431 | return i+1; /* index to be used next time */ | 431 | return i+1; /* index to be used next time */ |
432 | } | 432 | } |