feat & refactor: add more packetElement & refactor packetMsg

This commit is contained in:
pk5ls20
2024-10-18 16:01:54 +08:00
parent 524fd258d8
commit 698e095364
10 changed files with 119 additions and 38 deletions

View File

@@ -23,7 +23,9 @@ export class LimitedHashTable<K, V> {
}
while (this.keyToValue.size > this.maxSize || this.valueToKey.size > this.maxSize) {
const oldestKey = this.keyToValue.keys().next().value;
// @ts-ignore
this.valueToKey.delete(this.keyToValue.get(oldestKey)!);
// @ts-ignore
this.keyToValue.delete(oldestKey);
}
}