From ed2dd6874a905769c5cfc080333ab0b12f9a9fe8 Mon Sep 17 00:00:00 2001 From: ame Date: Thu, 24 Jul 2025 02:32:37 -0500 Subject: errors and then,, yknow fix them --- src/table.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/table.c') diff --git a/src/table.c b/src/table.c index ea57b2c..418da3a 100644 --- a/src/table.c +++ b/src/table.c @@ -184,8 +184,6 @@ int l_indexof(lua_State* L) { size_t start = argc == 3 ? luaL_checknumber(L,3) : 0; start = start > 0 ? start : start; - double cur = 0; - for(size_t i = 0; i <= len-1; i++){ lua_pushinteger(L,i+1); lua_gettable(L,1); @@ -202,15 +200,13 @@ int l_indexof(lua_State* L) { } int l_sindexof(lua_State* L) { - int argc = lua_gettop(L); double target = luaL_checknumber(L, 2); luaL_checktype(L, 1, LUA_TTABLE); size_t len = lua_objlen(L,1); int l = 0; int r = len - 1; - size_t cid = len/2; - for(size_t i = 0; l<=r; i++){ + for(; l<=r;){ int m = l + (r - l) /2; lua_pushinteger(L,m+1); lua_gettable(L,1); -- cgit v1.2.3