From 7229428741ba069d45acb10818f5fff257ec2f51 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 20 Jan 2013 21:55:08 +0100 Subject: [PATCH] Use in-place filtering for post-render functions --- src/ol/map.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ol/map.js b/src/ol/map.js index 6ab92eb8b8..eeac9aee97 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -530,13 +530,12 @@ ol.Map.prototype.handleMapBrowserEvent = function(mapBrowserEvent) { ol.Map.prototype.handlePostRender = function() { this.tileQueue_.reprioritize(); // FIXME only call if needed this.tileQueue_.loadMoreTiles(); - goog.array.forEach( - this.postRenderFunctions_, - function(postRenderFunction) { - postRenderFunction(this, this.frameState_); - }, - this); - this.postRenderFunctions_.length = 0; + var postRenderFunctions = this.postRenderFunctions_; + var i; + for (i = 0; i < postRenderFunctions.length; ++i) { + postRenderFunctions[i](this, this.frameState_); + } + postRenderFunctions.length = 0; };