Optimize index search loop with early break
Co-authored-by: netbrah <162479981+netbrah@users.noreply.github.com>
This commit is contained in:
parent
4a75c60cf4
commit
8cb04cea5c
1 changed files with 3 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue