fix: packet send/recv

This commit is contained in:
手瓜一十雪 committed 2024-10-12 19:51:29 +08:00
1 parent bb8b06c044
commit cdd00d665d
4 files changed
+31 -25

No files matched your search

+3 -1
View File
@@ -24,7 +24,9 @@ export class LRUCache<K, V> {
} else if (this.cache.size >= this.capacity) {
// If the cache is full, remove the least recently used key (the first one in the map)
const firstKey = this.cache.keys().next().value;
this.cache.delete(firstKey);
if (firstKey !== undefined) {
this.cache.delete(firstKey);
}
}
this.cache.set(key, value);
}