[Script] Return index on array.contains
This commit is contained in:
1 parent
e87301e160
commit
35a6bd9b41
1 file changed
+2
-2
@@ -180,11 +180,11 @@ ClassFunction(arrayContains) {
|
|||||||
|
|
||||||
if (caller->variableType == StringArrayClass) {
|
if (caller->variableType == StringArrayClass) {
|
||||||
if (!strcmp(arg->string.value, iter.string.value))
|
if (!strcmp(arg->string.value, iter.string.value))
|
||||||
return newIntVariablePtr(1);
|
return newIntVariablePtr(i + 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (arg->integer.value == iter.integer.value)
|
if (arg->integer.value == iter.integer.value)
|
||||||
return newIntVariablePtr(1);
|
return newIntVariablePtr(i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user