@@ -224,16 +224,10 @@ class Boot {
this["splice"](i,0,x);
};
Array.prototype["remove"] = function(obj) {
- var i = 0;
- var l = this["length"];
- while( i < l ) {
- if( this[i] == obj ) {
- this["splice"](i,1);
- return true;
- }
- i++;
- return false;
+ var idx = this["indexOf"](obj);
+ if( idx == -1 ) return false;
+ this["splice"](idx,1);
+ return true;
}
Array.prototype["iterator"] = function() {
return {
@@ -44,12 +44,10 @@ class Boot extends flash.display.MovieClip, implements Dynamic {
this.splice(i,0,x);
aproto.remove = function(obj) {
- for( i in 0...this.length )
- this.splice(i,1);
+ var idx = this.indexOf(obj);
+ this.splice(idx,1);
aproto.iterator = function() {
var cur = 0;
@@ -200,16 +200,10 @@ class Boot {
Array.prototype.remove = function(obj) {
- var l = this.length;
Array.prototype.iterator = function() {