Skip to content

Commit

Permalink
remove double list comprehension
Browse files Browse the repository at this point in the history
comp'ing a list in a list comp will cause the comp'ing to happen for
every item in the comp.
  • Loading branch information
ACEnglish committed Jan 31, 2024
1 parent 36fa6c0 commit 907f6ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion truvari/collapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def collapse_chunk(chunk, matcher):
m_collap.matches = [mats.pop(0)]

# Remove everything that was used
remaining_calls = [_ for _ in remaining_calls if _ not in [_.comp for _ in m_collap.matches]]
to_rm = [_.comp for _ in m_collap.matches]
remaining_calls = [_ for _ in remaining_calls if _ not in to_rm]

if matcher.no_consolidate:
for val in ret:
Expand Down

0 comments on commit 907f6ef

Please sign in to comment.