Speed up lru cache splice

This commit is contained in:
Jon Staab
2023-12-11 12:26:03 -08:00
parent 1e2d806d25
commit d01b05e2a2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ export class LRUCache<T, U> {
if (v !== undefined) {
this.keys.push(k as T)
if (this.keys.length > this.maxSize) {
if (this.keys.length > this.maxSize * 2) {
this.keys.splice(-this.maxSize)
}
}