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:
Tim Schaub
2008-07-31 04:44:25 +00:00
parent 89b10da8db
commit 66a4c6fb0e
50 changed files with 196 additions and 196 deletions
+4 -4
View File
@@ -627,12 +627,12 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
var resolution = this.getResolution();
var path = [];
var linearRing, i, comp, x, y;
for (var j = 0; j < geometry.components.length; j++) {
var linearRing, i, j, len, ilen, comp, x, y;
for (j = 0, len=geometry.components.length; j<len; j++) {
linearRing = geometry.components[j];
path.push("m");
for (i = 0; i < linearRing.components.length; i++) {
for (i=0, ilen=linearRing.components.length; i<ilen; i++) {
comp = linearRing.components[i];
x = comp.x / resolution;
y = comp.y / resolution;
@@ -679,7 +679,7 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
var path = [];
var comp, x, y;
for (var i = 0; i < geometry.components.length; i++) {
for (var i=0, len=geometry.components.length; i<len; i++) {
comp = geometry.components[i];
x = comp.x / resolution;
y = comp.y / resolution;