From: Michael Tremer Date: Fri, 27 Feb 2026 11:22:29 +0000 (+0000) Subject: lists: Perform whitelist check only if anything is actually whitelisted X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5fec63166e4ea5e7b815d78f660a9335d4fabb7;p=dbl.git lists: Perform whitelist check only if anything is actually whitelisted Signed-off-by: Michael Tremer --- 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)