aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ltable.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ltable.c b/ltable.c
index 77dae4e9..01b082e3 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 1.72 2001/01/29 17:16:58 roberto Exp roberto $ 2** $Id: ltable.c,v 1.73 2001/01/29 19:34:02 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*/
@@ -203,7 +203,7 @@ TObject *luaH_setnum (lua_State *L, Hash *t, lua_Number key) {
203 Node *mp = hashnum(t, key); 203 Node *mp = hashnum(t, key);
204 Node *n = mp; 204 Node *n = mp;
205 do { /* check whether `key' is somewhere in the chain */ 205 do { /* check whether `key' is somewhere in the chain */
206 if (nvalue_key(n) == key && ttype_key(n) == LUA_TNUMBER) 206 if (ttype_key(n) == LUA_TNUMBER && nvalue_key(n) == key)
207 return &n->val; /* that's all */ 207 return &n->val; /* that's all */
208 else n = n->next; 208 else n = n->next;
209 } while (n); 209 } while (n);
@@ -222,7 +222,7 @@ TObject *luaH_setstr (lua_State *L, Hash *t, TString *key) {
222 Node *mp = hashstr(t, key); 222 Node *mp = hashstr(t, key);
223 Node *n = mp; 223 Node *n = mp;
224 do { /* check whether `key' is somewhere in the chain */ 224 do { /* check whether `key' is somewhere in the chain */
225 if (tsvalue_key(n) == key && ttype_key(n) == LUA_TSTRING) 225 if (ttype_key(n) == LUA_TSTRING && tsvalue_key(n) == key)
226 return &n->val; /* that's all */ 226 return &n->val; /* that's all */
227 else n = n->next; 227 else n = n->next;
228 } while (n); 228 } while (n);
@@ -241,7 +241,7 @@ static TObject *luaH_setany (lua_State *L, Hash *t, const TObject *key) {
241 Node *n = mp; 241 Node *n = mp;
242 do { /* check whether `key' is somewhere in the chain */ 242 do { /* check whether `key' is somewhere in the chain */
243 /* compare as `tsvalue', but may be other pointers (it is the same) */ 243 /* compare as `tsvalue', but may be other pointers (it is the same) */
244 if (tsvalue_key(n) == tsvalue(key) && ttype_key(n) == ttype(key)) 244 if (ttype_key(n) == ttype(key) && tsvalue_key(n) == tsvalue(key))
245 return &n->val; /* that's all */ 245 return &n->val; /* that's all */
246 else n = n->next; 246 else n = n->next;
247 } while (n); 247 } while (n);