Optimize clearMemoryCache to O(1) using nested map structure

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-05 20:28:49 +00:00
1 parent b32c3dc39f
commit 0073bf223b
1 file changed
+5 -1
+5 -1
View File
@@ -367,8 +367,12 @@ class ProfileCache {
return userCache ? userCache.get(section) : undefined;
}
/**
* Clears all cached data for a specific public key from memory.
* This operation is O(1) thanks to the nested map structure.
* @param {string} pubkey - The hex public key to clear.
*/
clearMemoryCache(pubkey) {
// Optimized: O(1) deletion due to nested map structure
this.memoryCache.delete(pubkey);
}