From f51754fde4dbff16b7a6f708b7dbcd5fd120f0cc Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 7 Jun 2015 10:10:48 +0200 Subject: [PATCH] utils: Use a set rather than list Signed-off-by: Niels Thykier --- daklib/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/daklib/utils.py b/daklib/utils.py index 56513e61..12798ab2 100644 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -1136,6 +1136,7 @@ def check_reverse_depends(removals, suite, arches=None, session=None, cruft=Fals else: all_arches = set(x.arch_string for x in get_suite_architectures(suite)) all_arches -= set(["source", "all"]) + removal_set = set(removals) metakey_d = get_or_set_metadatakey("Depends", session) metakey_p = get_or_set_metadatakey("Provides", session) params = { @@ -1183,9 +1184,7 @@ def check_reverse_depends(removals, suite, arches=None, session=None, cruft=Fals # If a virtual package is only provided by the to-be-removed # packages, treat the virtual package as to-be-removed too. - for virtual_pkg in virtual_packages: - if virtual_packages[virtual_pkg] == 0: - removals.append(virtual_pkg) + removal_set.update(virtual_pkg for virtual_pkg in virtual_packages if not virtual_packages[virtual_pkg]) # Check binary dependencies (Depends) for package in deps: -- 2.39.2