🐛 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:
Gabriel Luiz Freitas Almeida 2023-06-30 10:09:56 -03:00
commit e01fe86caa

View file

@ -27,12 +27,7 @@ class Edge:
# Get what type of input the target node is expecting
self.matched_type = next(
(
output
for output in self.source_types
for target_req in self.target_reqs
if output in target_req
),
(output for output in self.source_types if output in self.target_reqs),
None,
)
no_matched_type = self.matched_type is None