Use in-place filtering for pre-render functions
This commit is contained in:
+9
-6
@@ -641,12 +641,15 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.preRenderFunctions_ = goog.array.filter(
|
var preRenderFunctions = this.preRenderFunctions_;
|
||||||
this.preRenderFunctions_,
|
var n = 0, preRenderFunction;
|
||||||
function(preRenderFunction) {
|
for (i = 0; i < preRenderFunctions.length; ++i) {
|
||||||
return preRenderFunction(this, frameState);
|
preRenderFunction = preRenderFunctions[i];
|
||||||
},
|
if (preRenderFunction(this, frameState)) {
|
||||||
this);
|
preRenderFunctions[n++] = preRenderFunction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
preRenderFunctions.length = n;
|
||||||
|
|
||||||
if (!goog.isNull(frameState)) {
|
if (!goog.isNull(frameState)) {
|
||||||
// FIXME works for View2D only
|
// FIXME works for View2D only
|
||||||
|
|||||||
Reference in New Issue
Block a user