This commit is contained in:
Christopher Jeffrey 2016-07-01 22:37:13 -07:00
parent 996bbc6b21
commit 4bf962638e
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -147,7 +147,7 @@ LRU.prototype.set = function set(key, value) {
return;
}
item = { key: key, value: value };
item = new LRUItem(key, value);
this.data[key] = item;
@ -307,6 +307,21 @@ LRU.prototype.toArray = function toArray() {
return items;
};
/**
* Represents an LRU item.
* @constructor
* @private
* @param {String} key
* @param {Object} value
*/
function LRUItem(key, value) {
this.key = key;
this.value = value;
this.next = null;
this.prev = null;
}
/*
* Expose
*/