Skip to content

Commit

Permalink
efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitvinnakota-codecov committed Dec 18, 2024
1 parent e818ef2 commit 1cdf274
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions graphql_api/types/impacted_file/impacted_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ def resolve_segments(
# segments with no diff changes and at least 1 unintended change
segments = [segment for segment in segments if segment.has_unintended_changes]
elif filters.get("has_unintended_changes") is False:
# segments with at least 1 diff change
segments = [segment for segment in segments if segment.has_diff_changes]
for s in segments:
s.remove_unintended_changes()
new_segments = []
for segment in segments:
if segment.has_diff_changes:
segment.remove_unintended_changes()
new_segments.append(segment)
segments = new_segments

return SegmentComparisons(results=segments)

Expand Down

0 comments on commit 1cdf274

Please sign in to comment.