This commit is contained in:
Yoshman29
2023-05-07 13:03:40 +02:00
parent aa8dab3b1a
commit 465b0ec5cb
+5 -3
View File
@@ -503,10 +503,12 @@ class CoolUtil
*/
public static inline function indexOfFromLast<T>(array:Array<T>, element:T):Int {
var i = array.length - 1;
while(i >= 0)
while(i >= 0) {
if (array[i] == element)
return i;
return -1;
break;
i--;
}
return i;
}
/**