diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-19 16:11:00 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-19 16:11:00 -0200 |
commit | 22dd271cbba22c0765eb45296a957ecacf68755e (patch) | |
tree | 748a079e9a54464a144020ab5d0beec27f606b9b /ltable.c | |
parent | e04f7ed4509af1577c10ead8e5d7d55c65754bf8 (diff) | |
download | lua-22dd271cbba22c0765eb45296a957ecacf68755e.tar.gz lua-22dd271cbba22c0765eb45296a957ecacf68755e.tar.bz2 lua-22dd271cbba22c0765eb45296a957ecacf68755e.zip |
another bug in next (when n is a power of 2)
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ | 2 | ** $Id: ltable.c,v 1.93 2001/12/11 22:48:44 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 | */ |
@@ -97,7 +97,7 @@ int luaH_index (lua_State *L, Table *t, const TObject *key) { | |||
97 | int i; | 97 | int i; |
98 | if (ttype(key) == LUA_TNIL) return -1; /* first iteration */ | 98 | if (ttype(key) == LUA_TNIL) return -1; /* first iteration */ |
99 | i = arrayindex(key); | 99 | i = arrayindex(key); |
100 | if (0 <= i && i < t->sizearray) { /* is `key' inside array part? */ | 100 | if (0 <= i && i <= t->sizearray) { /* is `key' inside array part? */ |
101 | return i-1; /* yes; that's the index (corrected to C) */ | 101 | return i-1; /* yes; that's the index (corrected to C) */ |
102 | } | 102 | } |
103 | else { | 103 | else { |