Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zachaysan committed Jan 27, 2025
1 parent 17defee commit e2a63be
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions api/segments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ def update_segment_with_matches_from_current_segment(
for current_rule in current_segment.rules.all():
for current_sub_rule in current_rule.rules.all():

# Because we must proceed to the next current_sub_rule
# to get the next available match since it has now been
# matched to a candidate modified_sub_rule we set the
# sub_rule_matched bool to track the state between
# iterations. Otherwise different rules would have the
# same value for their version_of field.
sub_rule_matched = False
for modified_rule in modified_rules:
# Because we must proceed to the next current_sub_rule
# to get the next available match since it has now been
# matched to a candidate modified_sub_rule we set the
# sub_rule_matched bool to track the state between
# iterations. Otherwise different rules would have the
# same value for their version_of field.
if sub_rule_matched:
break

Expand All @@ -268,7 +268,7 @@ def update_segment_with_matches_from_current_segment(
# the currently matched rules correspond to the current rule.
# Consider a scenario where a subrule's version_of attribute
# points to a different subrule, whose owning rule differs
# from the subrule's sibling's parent rule. Such a mismatch
# from the subrule's version_of's parent rule. Such a mismatch
# would lead to inconsistencies and unintended behavior.
if (
modified_rule in matched_rules
Expand Down

0 comments on commit e2a63be

Please sign in to comment.