From 354af5e24c2f1b2d356d27f609e2f512ef5b3cce Mon Sep 17 00:00:00 2001 From: getzze Date: Tue, 8 Oct 2024 21:19:02 +0100 Subject: [PATCH] use set instead of list --- subliminal/providers/opensubtitlescom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subliminal/providers/opensubtitlescom.py b/subliminal/providers/opensubtitlescom.py index 22a60659..493ef411 100644 --- a/subliminal/providers/opensubtitlescom.py +++ b/subliminal/providers/opensubtitlescom.py @@ -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)