🐛 fix(base.py): simplify the logic to find the matched_type in the Edge class
The logic to find the matched_type in the Edge class has been simplified by removing unnecessary nested loops and using a single generator expression. This improves the readability and efficiency of the code.
This commit is contained in:
parent
3bdc35d238
commit
e01fe86caa
1 changed files with 1 additions and 6 deletions
|
|
@ -27,12 +27,7 @@ class Edge:
|
||||||
# Get what type of input the target node is expecting
|
# Get what type of input the target node is expecting
|
||||||
|
|
||||||
self.matched_type = next(
|
self.matched_type = next(
|
||||||
(
|
(output for output in self.source_types if output in self.target_reqs),
|
||||||
output
|
|
||||||
for output in self.source_types
|
|
||||||
for target_req in self.target_reqs
|
|
||||||
if output in target_req
|
|
||||||
),
|
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
no_matched_type = self.matched_type is None
|
no_matched_type = self.matched_type is None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue