Caching array length instead of accessing it with each iteration. r=crschmidt (closes #1636)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7627 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -201,7 +201,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
|
||||
// brute force method
|
||||
var allNodes = node.getElementsByTagName("*");
|
||||
var potentialNode, fullName;
|
||||
for(var i=0; i<allNodes.length; ++i) {
|
||||
for(var i=0, len=allNodes.length; i<len; ++i) {
|
||||
potentialNode = allNodes[i];
|
||||
fullName = (potentialNode.prefix) ?
|
||||
(potentialNode.prefix + ":" + name) : name;
|
||||
@@ -234,7 +234,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
|
||||
} else {
|
||||
var attributes = node.attributes;
|
||||
var potentialNode, fullName;
|
||||
for(var i=0; i<attributes.length; ++i) {
|
||||
for(var i=0, len=attributes.length; i<len; ++i) {
|
||||
potentialNode = attributes[i];
|
||||
if(potentialNode.namespaceURI == uri) {
|
||||
fullName = (potentialNode.prefix) ?
|
||||
|
||||
Reference in New Issue
Block a user