diff --git a/js/state/profileCache.js b/js/state/profileCache.js index 91a30107..4e0bc561 100644 --- a/js/state/profileCache.js +++ b/js/state/profileCache.js @@ -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 using nested Map (pubkey -> section -> data) this.memoryCache.delete(pubkey); }