refactor: 响应Codex代码评审建议

This commit is contained in:
你的名字 committed 2026-02-23 10:28:51 +08:00
1 parent 6a86e69cd4
commit e89ccee5f4
3 files changed
+31 -2

No files matched your search

+21
View File
@@ -75,6 +75,27 @@ export class LRUCache<K, V> {
return this.cache.keys()
}
/**
* Get all values (for debugging)
*/
values(): IterableIterator<V> {
return this.cache.values()
}
/**
* Get all entries (for iteration support)
*/
entries(): IterableIterator<[K, V]> {
return this.cache.entries()
}
/**
* Make LRUCache iterable (for...of support)
*/
[Symbol.iterator](): IterableIterator<[K, V]> {
return this.cache.entries()
}
/**
* Force cleanup (optional method for explicit memory management)
*/