|
@@ -127,14 +127,14 @@ final class Array<T> implements ArrayAccess<Int, T> implements IteratorAggregate
|
|
|
|
|
|
public function remove(x:T):Bool {
|
|
|
var result = false;
|
|
|
- Syntax.foreach(arr, function(index:Int, value:T) {
|
|
|
- if (value == x) {
|
|
|
+ for(index in 0...length) {
|
|
|
+ if (arr[index] == x) {
|
|
|
Global.array_splice(arr, index, 1);
|
|
|
length--;
|
|
|
result = true;
|
|
|
- Syntax.code('break');
|
|
|
+ break;
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|