소스 검색

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() {