Skip to content

Commit

Permalink
[Script] Return index on array.contains
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Jan 21, 2022
1 parent e87301e commit 35a6bd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/script/arrayClass.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ ClassFunction(arrayContains) {

if (caller->variableType == StringArrayClass) {
if (!strcmp(arg->string.value, iter.string.value))
return newIntVariablePtr(1);
return newIntVariablePtr(i + 1);
}
else {
if (arg->integer.value == iter.integer.value)
return newIntVariablePtr(1);
return newIntVariablePtr(i + 1);
}
}

Expand Down

0 comments on commit 35a6bd9

Please sign in to comment.