aboutsummaryrefslogtreecommitdiff
path: root/src/table.c
diff options
context:
space:
mode:
authorame <[email protected]>2025-07-24 02:32:37 -0500
committerame <[email protected]>2025-07-24 02:32:37 -0500
commited2dd6874a905769c5cfc080333ab0b12f9a9fe8 (patch)
tree60e29dbb01635dc9a94e02709520baea1b63d5fe /src/table.c
parentb392bec30ebdd4c84446623193b82531b8001b88 (diff)
errors and then,, yknow fix them
Diffstat (limited to 'src/table.c')
-rw-r--r--src/table.c6
1 files changed, 1 insertions, 5 deletions
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);