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

View File

@@ -548,7 +548,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.virtualVertices = [];
var control = this;
function collectComponentVertices(geometry) {
var i, vertex, component;
var i, vertex, component, len;
if(geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
vertex = new OpenLayers.Feature.Vector(geometry);
control.vertices.push(vertex);
@@ -569,7 +569,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
// add virtual vertices in the middle of each edge
if(geometry.CLASS_NAME != "OpenLayers.Geometry.MultiPoint") {
for(i=0; i<geometry.components.length-1; ++i) {
for(i=0, len=geometry.components.length; i<len-1; ++i) {
var prevVertex = geometry.components[i];
var nextVertex = geometry.components[i + 1];
if(prevVertex.CLASS_NAME == "OpenLayers.Geometry.Point" &&