road0001 / as3isolib

Automatically exported from code.google.com/p/as3isolib
0 stars 0 forks source link

Node:getChildIndex slow #49

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call Node:getChildIndex

What is the expected output? What do you see instead?

Node:getChildIndex currently duplicate Array:indexOf functionality.

What version of the product are you using? On what operating system?

as3isolib.v1.core

Please provide any additional information below.

It's proper to replace
-            var i:int;
-            while ( i < numChildren )
-            {
-                if ( child == childrenArray[ i ])
-                    return i;
-                i++;
-            }
-            return -1;

with:

+            return childrenArray.indexOf(child);

Original issue reported on code.google.com by maxim.ga...@gmail.com on 4 Nov 2012 at 1:55

GoogleCodeExporter commented 8 years ago
how much improvement will this change yield? is "indexOf" implemented in the 
same way?

Original comment by patrick....@gmail.com on 11 Jan 2013 at 12:19