Remove opt_this param in ol/structs/LRUCache

This commit is contained in:
Frederic Junod
2019-04-08 13:23:43 +02:00
parent 617dd9f031
commit c20bdedcac
2 changed files with 4 additions and 6 deletions

View File

@@ -44,7 +44,7 @@ class TileCache extends LRUCache {
this.remove(getKey(tile.tileCoord));
tile.dispose();
}
}, this);
}.bind(this));
}
}

View File

@@ -96,17 +96,15 @@ class LRUCache extends EventTarget {
/**
* @param {function(this: S, T, string, LRUCache): ?} f The function
* @param {function(T, string, LRUCache): ?} f The function
* to call for every entry from the oldest to the newer. This function takes
* 3 arguments (the entry value, the entry key and the LRUCache object).
* The return value is ignored.
* @param {S=} opt_this The object to use as `this` in `f`.
* @template S
*/
forEach(f, opt_this) {
forEach(f) {
let entry = this.oldest_;
while (entry) {
f.call(opt_this, entry.value_, entry.key_, this);
f(entry.value_, entry.key_, this);
entry = entry.newer;
}
}