mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-24 02:37:05 +00:00
Fixed PLW0108 (unnecessary-lambda): Lambda may be unnecessary; consider inlining inner function
This commit is contained in:
parent
3d72c32b1d
commit
67b9d0b279
@ -38,7 +38,7 @@ def get_dns_zones(env):
|
|||||||
# Exclude domains that are subdomains of other domains we know. Proceed
|
# Exclude domains that are subdomains of other domains we know. Proceed
|
||||||
# by looking at shorter domains first.
|
# by looking at shorter domains first.
|
||||||
zone_domains = set()
|
zone_domains = set()
|
||||||
for domain in sorted(domains, key=lambda d : len(d)):
|
for domain in sorted(domains, key=len):
|
||||||
for d in zone_domains:
|
for d in zone_domains:
|
||||||
if domain.endswith("." + d):
|
if domain.endswith("." + d):
|
||||||
# We found a parent domain already in the list.
|
# We found a parent domain already in the list.
|
||||||
|
@ -59,7 +59,7 @@ def sort_domains(domain_names, env):
|
|||||||
# from shortest to longest since zones are always shorter than their
|
# from shortest to longest since zones are always shorter than their
|
||||||
# subdomains.
|
# subdomains.
|
||||||
zones = { }
|
zones = { }
|
||||||
for domain in sorted(domain_names, key=lambda d : len(d)):
|
for domain in sorted(domain_names, key=len):
|
||||||
for z in zones.values():
|
for z in zones.values():
|
||||||
if domain.endswith("." + z):
|
if domain.endswith("." + z):
|
||||||
# We found a parent domain already in the list.
|
# We found a parent domain already in the list.
|
||||||
|
Loading…
Reference in New Issue
Block a user