Skip to content

Commit

Permalink
lib: find_subgraph doesn't need to look in both func and afunc
Browse files Browse the repository at this point in the history
- if they both exist they're expected to share the same implementation, so looking in both is redundant
  • Loading branch information
nfcampos committed Nov 17, 2024
1 parent 84ef939 commit 7866bd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/langgraph/langgraph/pregel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def find_subgraph_pregel(candidate: Runnable) -> Optional[Runnable]:
nl.__self__ if hasattr(nl, "__self__") else nl
for nl in get_function_nonlocals(c.func)
)
if c.afunc is not None:
elif c.afunc is not None:
candidates.extend(
nl.__self__ if hasattr(nl, "__self__") else nl
for nl in get_function_nonlocals(c.afunc)
Expand Down

0 comments on commit 7866bd2

Please sign in to comment.