aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ltable.c b/ltable.c
index ab69c343..7b51da46 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.19 2005/03/16 16:58:41 roberto Exp roberto $ 2** $Id: ltable.c,v 2.20 2005/04/01 13:51:37 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*/
@@ -469,7 +469,8 @@ const TValue *luaH_get (Table *t, const TValue *key) {
469 case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); 469 case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key));
470 case LUA_TNUMBER: { 470 case LUA_TNUMBER: {
471 int k; 471 int k;
472 lua_number2int(k, (nvalue(key))); 472 lua_Number n = nvalue(key);
473 lua_number2int(k, n);
473 if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ 474 if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */
474 return luaH_getnum(t, k); /* use specialized version */ 475 return luaH_getnum(t, k); /* use specialized version */
475 /* else go through */ 476 /* else go through */