diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-12-30 11:14:46 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-12-30 11:14:46 -0200 |
commit | 9a455438417b45be12b763ca56005b32bf0bb017 (patch) | |
tree | 9439ba61ebd0606aebf97f8ba445d16dee5e4b20 /ltable.c | |
parent | 766e67ef3b2af42f800b281e0fa0f57c7e3d2e3f (diff) | |
download | lua-9a455438417b45be12b763ca56005b32bf0bb017.tar.gz lua-9a455438417b45be12b763ca56005b32bf0bb017.tar.bz2 lua-9a455438417b45be12b763ca56005b32bf0bb017.zip |
tables are better manipulated via "Hash *" instead of "TObject" or
"lua_Object".
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 1.14 1998/08/10 21:36:32 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.15 1998/08/11 16:38:34 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -181,8 +181,7 @@ TObject *luaH_set (Hash *t, TObject *ref) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | 183 | ||
184 | static Node *hashnext (Hash *t, int i) | 184 | static Node *hashnext (Hash *t, int i) { |
185 | { | ||
186 | Node *n; | 185 | Node *n; |
187 | int tsize = nhash(t); | 186 | int tsize = nhash(t); |
188 | if (i >= tsize) | 187 | if (i >= tsize) |
@@ -196,9 +195,7 @@ static Node *hashnext (Hash *t, int i) | |||
196 | return node(t, i); | 195 | return node(t, i); |
197 | } | 196 | } |
198 | 197 | ||
199 | Node *luaH_next (TObject *o, TObject *r) | 198 | Node *luaH_next (Hash *t, TObject *r) { |
200 | { | ||
201 | Hash *t = avalue(o); | ||
202 | if (ttype(r) == LUA_T_NIL) | 199 | if (ttype(r) == LUA_T_NIL) |
203 | return hashnext(t, 0); | 200 | return hashnext(t, 0); |
204 | else { | 201 | else { |