From 40eddf442a2f10d0ed212d8a23e380b43f4858ba Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Wed, 25 Feb 2026 23:39:58 +0800 Subject: [PATCH] refactor(memory_store): simplify list comprehension expressions --- reme/core/memory_store/local_memory_store.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/reme/core/memory_store/local_memory_store.py b/reme/core/memory_store/local_memory_store.py index d6c5d31c..0f7098da 100644 --- a/reme/core/memory_store/local_memory_store.py +++ b/reme/core/memory_store/local_memory_store.py @@ -185,8 +185,7 @@ class LocalMemoryStore(BaseMemoryStore): for source_key, source_meta in self._files.items(): if path in source_meta: source_meta[path].chunk_count = sum( - 1 for chunk in self._chunks.values() - if chunk.path == path and chunk.source.value == source_key + 1 for chunk in self._chunks.values() if chunk.path == path and chunk.source.value == source_key ) async def upsert_chunks( @@ -249,8 +248,7 @@ class LocalMemoryStore(BaseMemoryStore): # Collect candidate chunks with embeddings candidates = [ - chunk for chunk in self._chunks.values() - if (not sources or chunk.source in sources) and chunk.embedding + chunk for chunk in self._chunks.values() if (not sources or chunk.source in sources) and chunk.embedding ] if not candidates: