From a5fec63166e4ea5e7b815d78f660a9335d4fabb7 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 27 Feb 2026 11:22:29 +0000 Subject: [PATCH] lists: Perform whitelist check only if anything is actually whitelisted Signed-off-by: Michael Tremer --- src/dbl/lists.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dbl/lists.py b/src/dbl/lists.py index 70e03a6..df7e139 100644 --- a/src/dbl/lists.py +++ b/src/dbl/lists.py @@ -827,11 +827,12 @@ class List(sqlmodel.SQLModel, database.BackendMixin, table=True): redundant_names = set() # List everything that isn't whitelisted - for name in names: - if util.is_name_in(name, whitelisted): - delisted_names.add(name) + if whitelisted: + for name in names: + if util.is_name_in(name, whitelisted): + delisted_names.add(name) - # Walk through all domains + # Find any redundant domains for name in names: if util.is_parent_in(name, names): redundant_names.add(name) -- 2.47.3