diff options
Diffstat (limited to 'ltable.c')
| -rw-r--r-- | ltable.c | 14 |
1 files changed, 10 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 1.108 2002/05/15 18:57:44 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.109 2002/05/27 20:35:40 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 | */ |
| @@ -76,9 +76,15 @@ Node *luaH_mainposition (const Table *t, const TObject *key) { | |||
| 76 | return hashboolean(t, bvalue(key)); | 76 | return hashboolean(t, bvalue(key)); |
| 77 | case LUA_TUDATAVAL: | 77 | case LUA_TUDATAVAL: |
| 78 | return hashpointer(t, pvalue(key)); | 78 | return hashpointer(t, pvalue(key)); |
| 79 | default: /* other types are hashed as (struct *) */ | 79 | case LUA_TUSERDATA: |
| 80 | return hashpointer(t, tsvalue(key)); | 80 | return hashpointer(t, uvalue(key)); |
| 81 | case LUA_TFUNCTION: | ||
| 82 | return hashpointer(t, clvalue(key)); | ||
| 83 | case LUA_TTABLE: | ||
| 84 | return hashpointer(t, hvalue(key)); | ||
| 81 | } | 85 | } |
| 86 | lua_assert(0); | ||
| 87 | return 0; /* to avoid warnings */ | ||
| 82 | } | 88 | } |
| 83 | 89 | ||
| 84 | 90 | ||
| @@ -391,7 +397,7 @@ static const TObject *luaH_getany (Table *t, const TObject *key) { | |||
| 391 | else { | 397 | else { |
| 392 | Node *n = luaH_mainposition(t, key); | 398 | Node *n = luaH_mainposition(t, key); |
| 393 | do { /* check whether `key' is somewhere in the chain */ | 399 | do { /* check whether `key' is somewhere in the chain */ |
| 394 | if (luaO_equalObj(key(n), key)) return val(n); /* that's it */ | 400 | if (luaO_rawequalObj(key(n), key)) return val(n); /* that's it */ |
| 395 | else n = n->next; | 401 | else n = n->next; |
| 396 | } while (n); | 402 | } while (n); |
| 397 | return &luaO_nilobject; | 403 | return &luaO_nilobject; |
