瀏覽代碼

Merge pull request #4881 from delahee/patch-4

Optimize regular array remove so that is does not allocate any longer
Nicolas Cannasse 9 年之前
父節點
當前提交
fbb1e328da
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      std/flash/Boot.hx

+ 4 - 0
std/flash/Boot.hx

@@ -242,7 +242,11 @@ class Boot extends flash.display.MovieClip {
 		aproto.remove = function(obj) {
 			var idx = __this__.indexOf(obj);
 			if( idx == -1 ) return false;
+			#if flash19
+			__this__.removeAt(idx);
+			#else
 			__this__.splice(idx,1);
+			#end
 			return true;
 		}
 		aproto.iterator = function() {