lru again.
This commit is contained in:
parent
6062972da5
commit
9e4e6c8242
@ -139,9 +139,6 @@ LRU.prototype.reset = function reset() {
|
|||||||
LRU.prototype.set = function set(key, value) {
|
LRU.prototype.set = function set(key, value) {
|
||||||
var item;
|
var item;
|
||||||
|
|
||||||
if (value === undefined)
|
|
||||||
throw new Error('Cannot set value to undefined.');
|
|
||||||
|
|
||||||
key = key + '';
|
key = key + '';
|
||||||
|
|
||||||
item = this.data[key];
|
item = this.data[key];
|
||||||
@ -196,7 +193,7 @@ LRU.prototype.get = function get(key) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
LRU.prototype.has = function get(key) {
|
LRU.prototype.has = function get(key) {
|
||||||
return this.data[key] !== undefined;
|
return this.data[key] != null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user