Skip to content

Commit 830de71

Browse files
committed
refactor(connection.py): remove duplicated code in contained_in()
case is already handled in code below
1 parent 21e4cc0 commit 830de71

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/_balder/connection.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -722,17 +722,12 @@ def contained_in(
722722

723723
else:
724724
# the elements itself do not match -> go deeper within the other connection
725-
if isinstance(resolved_other, AndConnectionRelation):
726-
# check if the current connection fits in one of the AND relation items -> allowed too (f.e. a
727-
# smaller AND contained in a bigger AND)
728-
for cur_other_and_element in resolved_other.connections:
729-
if resolved_self.contained_in(cur_other_and_element, ignore_metadata=ignore_metadata):
730-
return True
731725

732726
resolved_other_relation = resolved_other.based_on_elements \
733727
if isinstance(resolved_other, Connection) else resolved_other
734728

735729
for cur_other_based_on in resolved_other_relation.connections:
730+
# `cur_other_based_on` can only be a Connection or an AND (resolved can not ba a inner OR)
736731
if isinstance(cur_other_based_on, AndConnectionRelation):
737732
# check if the current connection fits in one of the AND relation items -> allowed too (f.e. a
738733
# smaller AND contained in a bigger AND)

0 commit comments

Comments
 (0)