Repository: flex-asjs
Updated Branches:
  refs/heads/tlf 891a2cfdb -> e757350c7


Attempt to make XML more efficient


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e757350c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e757350c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e757350c

Branch: refs/heads/tlf
Commit: e757350c75ca5cecbf8e8ef9d76ea3b54ac91a92
Parents: 891a2cf
Author: Harbs <[email protected]>
Authored: Mon May 8 11:19:57 2017 +0300
Committer: Harbs <[email protected]>
Committed: Mon May 8 11:19:57 2017 +0300

----------------------------------------------------------------------
 frameworks/projects/XML/src/main/flex/XML.as | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e757350c/frameworks/projects/XML/src/main/flex/XML.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/XML.as 
b/frameworks/projects/XML/src/main/flex/XML.as
index 912e1f0..3ee0079 100644
--- a/frameworks/projects/XML/src/main/flex/XML.as
+++ b/frameworks/projects/XML/src/main/flex/XML.as
@@ -157,15 +157,19 @@ package
                {
                        var i:int;
                        // add attributes
-                       for(i=0;i<node.attributes.length;i++)
+                       var attrs:* = node.attributes;
+                       var len:int = node.attributes.length;
+                       for(i=0;i<len;i++)
                        {
-                               insertAttribute(node.attributes[i],xml);
+                               insertAttribute(attrs[i],xml);
                        }
                        // loop through childNodes which will be one of:
                        // text, cdata, processing instrution or comment and 
add them as children of the element
-                       for(i=0;i<node.childNodes.length;i++)
+                       var childNodes:NodeList = node.childNodes;
+                       len = childNodes.length;
+                       for(i=0;i<len;i++)
                        {
-                               var child:XML = fromNode(node.childNodes[i]);
+                               var child:XML = fromNode(childNodes[i]);
                                xml.addChild(child);
                        }
                }

Reply via email to