From 139bcca26aac04914e9bee9e7538dd6a5a4a6e91 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 15 Sep 2015 10:05:57 +0200 Subject: [PATCH] Use goog.array.forEach to unlisten the array of keys --- src/ol/map.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ol/map.js b/src/ol/map.js index 13c5efccbf..bcfa364b5b 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -1118,10 +1118,8 @@ ol.Map.prototype.handleLayerGroupPropertyChanged_ = function(event) { */ ol.Map.prototype.handleLayerGroupChanged_ = function() { if (!goog.isNull(this.layerGroupPropertyListenerKeys_)) { - var length = this.layerGroupPropertyListenerKeys_.length; - for (var i = 0; i < length; ++i) { - goog.events.unlistenByKey(this.layerGroupPropertyListenerKeys_[i]); - } + goog.array.forEach(this.layerGroupPropertyListenerKeys_, + goog.events.unlistenByKey); this.layerGroupPropertyListenerKeys_ = null; } var layerGroup = this.getLayerGroup();