diff options
| -rw-r--r-- | ltable.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 2.70 2012/02/01 21:57:15 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.71 2012/05/23 15:37:09 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 | */ |
| @@ -480,13 +480,13 @@ const TValue *luaH_getstr (Table *t, TString *key) { | |||
| 480 | */ | 480 | */ |
| 481 | const TValue *luaH_get (Table *t, const TValue *key) { | 481 | const TValue *luaH_get (Table *t, const TValue *key) { |
| 482 | switch (ttype(key)) { | 482 | switch (ttype(key)) { |
| 483 | case LUA_TNIL: return luaO_nilobject; | ||
| 484 | case LUA_TSHRSTR: return luaH_getstr(t, rawtsvalue(key)); | 483 | case LUA_TSHRSTR: return luaH_getstr(t, rawtsvalue(key)); |
| 484 | case LUA_TNIL: return luaO_nilobject; | ||
| 485 | case LUA_TNUMBER: { | 485 | case LUA_TNUMBER: { |
| 486 | int k; | 486 | int k; |
| 487 | lua_Number n = nvalue(key); | 487 | lua_Number n = nvalue(key); |
| 488 | lua_number2int(k, n); | 488 | lua_number2int(k, n); |
| 489 | if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */ | 489 | if (luai_numeq(cast_num(k), n)) /* index is int? */ |
| 490 | return luaH_getint(t, k); /* use specialized version */ | 490 | return luaH_getint(t, k); /* use specialized version */ |
| 491 | /* else go through */ | 491 | /* else go through */ |
| 492 | } | 492 | } |
