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:
@@ -131,7 +131,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
var coords = OpenLayers.String.trim(line[0].firstChild.nodeValue).split(/\s+/);
|
||||
var components = [];
|
||||
var point;
|
||||
for (var i=0; i < coords.length; i+=2) {
|
||||
for (var i=0, len=coords.length; i<len; i+=2) {
|
||||
point = new OpenLayers.Geometry.Point(parseFloat(coords[i+1]),
|
||||
parseFloat(coords[i]));
|
||||
components.push(point);
|
||||
@@ -141,7 +141,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
var coords = OpenLayers.String.trim(polygon[0].firstChild.nodeValue).split(/\s+/);
|
||||
var components = [];
|
||||
var point;
|
||||
for (var i=0; i < coords.length; i+=2) {
|
||||
for (var i=0, len=coords.length; i<len; i+=2) {
|
||||
point = new OpenLayers.Geometry.Point(parseFloat(coords[i+1]),
|
||||
parseFloat(coords[i]));
|
||||
components.push(point);
|
||||
@@ -275,7 +275,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
var georss;
|
||||
if(features instanceof Array) {
|
||||
georss = this.createElementNS(this.rssns, "rss");
|
||||
for(var i=0; i < features.length; i++) {
|
||||
for(var i=0, len=features.length; i<len; i++) {
|
||||
georss.appendChild(this.createFeatureXML(features[i]));
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user