Use opt_this instead of opt_obj in ol.structs.LRUCache

This commit is contained in:
Tom Payne
2014-01-15 15:09:01 +01:00
parent d132d22f4d
commit fdea683242

View File

@@ -102,13 +102,13 @@ ol.structs.LRUCache.prototype.containsKey = function(key) {
* 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_obj The object to be used as the value of 'this' within f.
* @param {S=} opt_this The object to use as `this` in `f`.
* @template S
*/
ol.structs.LRUCache.prototype.forEach = function(f, opt_obj) {
ol.structs.LRUCache.prototype.forEach = function(f, opt_this) {
var entry = this.oldest_;
while (!goog.isNull(entry)) {
f.call(opt_obj, entry.value_, entry.key_, this);
f.call(opt_this, entry.value_, entry.key_, this);
entry = entry.newer;
}
};