diff options
Diffstat (limited to '')
| -rw-r--r-- | ltablib.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltablib.c,v 1.6 2002/06/13 13:44:50 roberto Exp roberto $ | 2 | ** $Id: ltablib.c,v 1.7 2002/06/18 15:16:18 roberto Exp roberto $ |
| 3 | ** Library for Table Manipulation | 3 | ** Library for Table Manipulation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -25,7 +25,7 @@ static int luaB_foreachi (lua_State *L) { | |||
| 25 | lua_pushvalue(L, 2); /* function */ | 25 | lua_pushvalue(L, 2); /* function */ |
| 26 | lua_pushnumber(L, i); /* 1st argument */ | 26 | lua_pushnumber(L, i); /* 1st argument */ |
| 27 | lua_rawgeti(L, 1, i); /* 2nd argument */ | 27 | lua_rawgeti(L, 1, i); /* 2nd argument */ |
| 28 | lua_upcall(L, 2, 1); | 28 | lua_call(L, 2, 1); |
| 29 | if (!lua_isnil(L, -1)) | 29 | if (!lua_isnil(L, -1)) |
| 30 | return 1; | 30 | return 1; |
| 31 | lua_pop(L, 1); /* remove nil result */ | 31 | lua_pop(L, 1); /* remove nil result */ |
| @@ -44,7 +44,7 @@ static int luaB_foreach (lua_State *L) { | |||
| 44 | lua_pushvalue(L, 2); /* function */ | 44 | lua_pushvalue(L, 2); /* function */ |
| 45 | lua_pushvalue(L, -3); /* key */ | 45 | lua_pushvalue(L, -3); /* key */ |
| 46 | lua_pushvalue(L, -3); /* value */ | 46 | lua_pushvalue(L, -3); /* value */ |
| 47 | lua_upcall(L, 2, 1); | 47 | lua_call(L, 2, 1); |
| 48 | if (!lua_isnil(L, -1)) | 48 | if (!lua_isnil(L, -1)) |
| 49 | return 1; | 49 | return 1; |
| 50 | lua_pop(L, 2); /* remove value and result */ | 50 | lua_pop(L, 2); /* remove value and result */ |
| @@ -128,7 +128,7 @@ static int sort_comp (lua_State *L, int a, int b) { | |||
| 128 | lua_pushvalue(L, 2); | 128 | lua_pushvalue(L, 2); |
| 129 | lua_pushvalue(L, a-1); /* -1 to compensate function */ | 129 | lua_pushvalue(L, a-1); /* -1 to compensate function */ |
| 130 | lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */ | 130 | lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */ |
| 131 | lua_upcall(L, 2, 1); | 131 | lua_call(L, 2, 1); |
| 132 | res = lua_toboolean(L, -1); | 132 | res = lua_toboolean(L, -1); |
| 133 | lua_pop(L, 1); | 133 | lua_pop(L, 1); |
| 134 | return res; | 134 | return res; |
