Remove opt_this param in ol/structs/RBush
This commit is contained in:
@@ -485,7 +485,7 @@ class VectorSource extends Source {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.featuresRtree_) {
|
if (this.featuresRtree_) {
|
||||||
this.featuresRtree_.forEach(this.removeFeatureInternal, this);
|
this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this));
|
||||||
for (const id in this.nullGeometryFeatures_) {
|
for (const id in this.nullGeometryFeatures_) {
|
||||||
this.removeFeatureInternal(this.nullGeometryFeatures_[id]);
|
this.removeFeatureInternal(this.nullGeometryFeatures_[id]);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-15
@@ -156,41 +156,35 @@ class RBush {
|
|||||||
* Calls a callback function with each value in the tree.
|
* Calls a callback function with each value in the tree.
|
||||||
* If the callback returns a truthy value, this value is returned without
|
* If the callback returns a truthy value, this value is returned without
|
||||||
* checking the rest of the tree.
|
* checking the rest of the tree.
|
||||||
* @param {function(this: S, T): *} callback Callback.
|
* @param {function(T): *} callback Callback.
|
||||||
* @param {S=} opt_this The object to use as `this` in `callback`.
|
|
||||||
* @return {*} Callback return value.
|
* @return {*} Callback return value.
|
||||||
* @template S
|
|
||||||
*/
|
*/
|
||||||
forEach(callback, opt_this) {
|
forEach(callback) {
|
||||||
return this.forEach_(this.getAll(), callback, opt_this);
|
return this.forEach_(this.getAll(), callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls a callback function with each value in the provided extent.
|
* Calls a callback function with each value in the provided extent.
|
||||||
* @param {import("../extent.js").Extent} extent Extent.
|
* @param {import("../extent.js").Extent} extent Extent.
|
||||||
* @param {function(this: S, T): *} callback Callback.
|
* @param {function(T): *} callback Callback.
|
||||||
* @param {S=} opt_this The object to use as `this` in `callback`.
|
|
||||||
* @return {*} Callback return value.
|
* @return {*} Callback return value.
|
||||||
* @template S
|
|
||||||
*/
|
*/
|
||||||
forEachInExtent(extent, callback, opt_this) {
|
forEachInExtent(extent, callback) {
|
||||||
return this.forEach_(this.getInExtent(extent), callback, opt_this);
|
return this.forEach_(this.getInExtent(extent), callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<T>} values Values.
|
* @param {Array<T>} values Values.
|
||||||
* @param {function(this: S, T): *} callback Callback.
|
* @param {function(T): *} callback Callback.
|
||||||
* @param {S=} opt_this The object to use as `this` in `callback`.
|
|
||||||
* @private
|
* @private
|
||||||
* @return {*} Callback return value.
|
* @return {*} Callback return value.
|
||||||
* @template S
|
|
||||||
*/
|
*/
|
||||||
forEach_(values, callback, opt_this) {
|
forEach_(values, callback) {
|
||||||
let result;
|
let result;
|
||||||
for (let i = 0, l = values.length; i < l; i++) {
|
for (let i = 0, l = values.length; i < l; i++) {
|
||||||
result = callback.call(opt_this, values[i]);
|
result = callback(values[i]);
|
||||||
if (result) {
|
if (result) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user