From 0d01a4ca0fea36cd6317e093a1b7a8f03cfbf36f Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 8 Nov 2017 11:45:23 +0100 Subject: [PATCH] Don't use getHints if it's not needed memory optimization: `getHints` creates a copy of the hints array. --- src/ol/view.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/view.js b/src/ol/view.js index ddfefe4a35..a51be2199c 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -341,7 +341,7 @@ ol.View.prototype.animate = function(var_args) { * @api */ ol.View.prototype.getAnimating = function() { - return this.getHints()[ol.ViewHint.ANIMATING] > 0; + return this.hints_[ol.ViewHint.ANIMATING] > 0; }; @@ -351,7 +351,7 @@ ol.View.prototype.getAnimating = function() { * @api */ ol.View.prototype.getInteracting = function() { - return this.getHints()[ol.ViewHint.INTERACTING] > 0; + return this.hints_[ol.ViewHint.INTERACTING] > 0; }; @@ -360,7 +360,7 @@ ol.View.prototype.getInteracting = function() { * @api */ ol.View.prototype.cancelAnimations = function() { - this.setHint(ol.ViewHint.ANIMATING, -this.getHints()[ol.ViewHint.ANIMATING]); + this.setHint(ol.ViewHint.ANIMATING, -this.hints_[ol.ViewHint.ANIMATING]); for (var i = 0, ii = this.animations_.length; i < ii; ++i) { var series = this.animations_[i]; if (series[0].callback) {