From e01fe86caa056d8177f0666918e11c01619a60e3 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 30 Jun 2023 10:09:56 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(base.py):=20simplify=20the?= =?UTF-8?q?=20logic=20to=20find=20the=20matched=5Ftype=20in=20the=20Edge?= =?UTF-8?q?=20class=20The=20logic=20to=20find=20the=20matched=5Ftype=20in?= =?UTF-8?q?=20the=20Edge=20class=20has=20been=20simplified=20by=20removing?= =?UTF-8?q?=20unnecessary=20nested=20loops=20and=20using=20a=20single=20ge?= =?UTF-8?q?nerator=20expression.=20This=20improves=20the=20readability=20a?= =?UTF-8?q?nd=20efficiency=20of=20the=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/graph/edge/base.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/backend/langflow/graph/edge/base.py b/src/backend/langflow/graph/edge/base.py index 08f084a5c..88a177e40 100644 --- a/src/backend/langflow/graph/edge/base.py +++ b/src/backend/langflow/graph/edge/base.py @@ -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