From 112bdddf110ca0086e6e3f279bfa12a1fc5e6221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 30 Nov 2018 17:30:17 +0000 Subject: [PATCH] xep_0384: Use set instead of list for no_eligible_devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.py b/plugin.py index 9cc5519..3b876af 100644 --- a/plugin.py +++ b/plugin.py @@ -8,7 +8,7 @@ import logging -from typing import Any, Dict, List, Union +from typing import Any, Dict, List, Set, Union import os import json @@ -313,7 +313,7 @@ class XEP_0384(BasePlugin): if not errors: break - no_eligible_devices = [] + no_eligible_devices = set() # type: Set[str] for (exn, key, val) in errors: if isinstance(exn, MissingBundleException): @@ -336,7 +336,7 @@ class XEP_0384(BasePlugin): if any(self._fetching_bundle(key, *err) for err in errors): continue - no_eligible_devices.append(key) + no_eligible_devices.add(key) if no_eligible_devices: raise NoEligibleDevices(no_eligible_devices)