Optimize index search loop with early break

Co-authored-by: netbrah <162479981+netbrah@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-22 20:20:59 +00:00
parent 4a75c60cf4
commit 8cb04cea5c

View file

@ -247,6 +247,9 @@ class Neo4JStorage(BaseGraphStorage):
existing_index = idx
elif idx["name"] == legacy_index_name:
legacy_index = idx
# Break early if we found both indexes
if existing_index and legacy_index:
break
# Handle legacy index migration
if legacy_index and not existing_index: