Skip to content

Commit

Permalink
use set instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Oct 8, 2024
1 parent 70229ea commit 354af5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subliminal/providers/opensubtitlescom.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,8 @@ def query(
)

# Some criteria are redundant, so skip duplicates
unique_ids = [s.id for s in subtitles]
# Use set for faster search
unique_ids = {s.id for s in subtitles}
if subtitle.id not in unique_ids:
logger.debug('Found subtitle %r', subtitle)
subtitles.append(subtitle)
Expand Down

0 comments on commit 354af5e

Please sign in to comment.