diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-09-11 16:37:16 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-09-11 16:37:16 -0300 |
commit | 8287a0db555fa24ff5977e73e2f961391e42cea5 (patch) | |
tree | db9c0380467f941cf38242e53b28de6de7eb576c | |
parent | cf160abcf9f7d42d1acf841f7720cb8c2baa5e3c (diff) | |
download | lua-8287a0db555fa24ff5977e73e2f961391e42cea5.tar.gz lua-8287a0db555fa24ff5977e73e2f961391e42cea5.tar.bz2 lua-8287a0db555fa24ff5977e73e2f961391e42cea5.zip |
detail
-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 | } |