Use a loop variable to avoid array lookups and use one if clause instead of two. Non-functional change (see #2764)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10577 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2010-08-04 08:10:40 +00:00
parent ea1290f8d8
commit f0736370f3

View File

@@ -187,12 +187,12 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
this.redraw();
return;
}
var c;
for (var i=0, len=this.controls.length; i<len; i++) {
if (this.controls[i] != control) {
if (this.controls[i].type === OpenLayers.Control.TYPE_TOOL ||
this.controls[i].type === null) {
this.controls[i].deactivate();
}
c = this.controls[i];
if (c != control &&
(c.type === OpenLayers.Control.TYPE_TOOL || c.type == null)) {
c.deactivate();
}
}
control.activate();