lib: find_subgraph doesn't need to look in both func and afunc

- if they both exist they're expected to share the same implementation, so looking in both is redundant
This commit is contained in:
Nuno Campos
2024-11-16 16:57:32 -08:00
parent 84ef939bf4
commit 7866bd2718
+1 -1
View File
@@ -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)