diff --git a/lbaselib.c b/lbaselib.c index d28708af..a84e682d 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.243 2010/04/19 17:02:02 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.244 2010/06/10 21:29:47 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -210,15 +210,13 @@ static int luaB_pairs (lua_State *L) { } -#if defined(LUA_COMPAT_IPAIRS) - static int ipairsaux (lua_State *L) { int i = luaL_checkint(L, 2); luaL_checktype(L, 1, LUA_TTABLE); i++; /* next value */ lua_pushinteger(L, i); lua_rawgeti(L, 1, i); - return (lua_isnil(L, -1) && i > luaL_len(L, 1)) ? 0 : 2; + return (lua_isnil(L, -1)) ? 1 : 2; } @@ -226,14 +224,6 @@ static int luaB_ipairs (lua_State *L) { return pairsmeta(L, "__ipairs", 1, ipairsaux); } -#else - -static int luaB_ipairs (lua_State *L) { - return luaL_error(L, "'ipairs' deprecated"); -} - -#endif - static int load_aux (lua_State *L, int status) { if (status == LUA_OK)