From 807375710d2cf748fc9a3f9cb3c9be1113c15e71 Mon Sep 17 00:00:00 2001 From: Taisir Hassan Date: Tue, 12 May 2026 18:08:37 -0700 Subject: [PATCH] Remove duplicate pop in InMemoryCacheProvider.remove The second self._cache.pop(key, None) call is a guaranteed no-op: the first pop has already removed the key (or returned None), and there is no await between the two statements that could allow another coroutine to re-add it. Removing the dead line clarifies intent without changing behavior. --- python/packages/purview/agent_framework_purview/_cache.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/packages/purview/agent_framework_purview/_cache.py b/python/packages/purview/agent_framework_purview/_cache.py index d559895a63..df5d03b97e 100644 --- a/python/packages/purview/agent_framework_purview/_cache.py +++ b/python/packages/purview/agent_framework_purview/_cache.py @@ -161,7 +161,6 @@ async def remove(self, key: str) -> None: entry = self._cache.pop(key, None) if entry is not None: self._current_size_bytes -= entry[2] - self._cache.pop(key, None) def create_protection_scopes_cache_key(request: ProtectionScopesRequest) -> str: