Speed up lru cache splice
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paravel",
|
||||
"version": "0.4.14",
|
||||
"version": "0.4.15",
|
||||
"description": "Yet another toolkit for nostr",
|
||||
"author": "hodlbod",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user