lru again.

This commit is contained in:
Christopher Jeffrey 2016-07-01 23:58:48 -07:00
parent 6062972da5
commit 9e4e6c8242
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -139,9 +139,6 @@ LRU.prototype.reset = function reset() {
LRU.prototype.set = function set(key, value) {
var item;
if (value === undefined)
throw new Error('Cannot set value to undefined.');
key = key + '';
item = this.data[key];
@ -196,7 +193,7 @@ LRU.prototype.get = function get(key) {
*/
LRU.prototype.has = function get(key) {
return this.data[key] !== undefined;
return this.data[key] != null;
};
/**