Method for peeking at the newest cache entry key
This commit is contained in:
@@ -196,6 +196,15 @@ ol.structs.LRUCache.prototype.peekLastKey = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the key of the newest item in the cache. Throws if the cache is empty.
|
||||
* @return {string} The newest key.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.peekFirstKey = function() {
|
||||
return this.newest_.key_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {T} value Value.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user