aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-14 17:13:31 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-14 17:13:31 -0200
commit4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec (patch)
treed11eee681ce7b01a273e489f47e070494b51de1a /lapi.c
parentb6ebbb2fee13aa223fdd12921cd0411e02db9dd0 (diff)
downloadlua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.gz
lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.bz2
lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.zip
new implementation of hash tables.
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lapi.c b/lapi.c
index 5c0646ec..80e4d120 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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
424int luaA_next (const Hash *t, int i) { 424int 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 }