Garrett Johnson пре 5 година
родитељ
комит
1961f0f73e
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      src/utilities/LRUCache.js

+ 4 - 1
src/utilities/LRUCache.js

@@ -14,9 +14,12 @@ class LRUCache {
 		this.minSize = 600;
 		this.unloadPercent = 0.05;
 
-		this.usedSet = new Set();
+		// "itemSet" doubles as both the list of the full set of items currently
+		// stored in the cache (keys) as well as a map to the time the item was last
+		// used so it can be sorted appropriately.
 		this.itemSet = new Map();
 		this.itemList = [];
+		this.usedSet = new Set();
 		this.callbacks = new Map();
 
 		this.unloadPriorityCallback = null;