find_redundant: detect full duplicate too

This commit is contained in:
Felix Yan 2018-12-28 13:54:36 +08:00
parent 66c6a11e3a
commit c2510c2e2c
No known key found for this signature in database
GPG Key ID: 786C63F330D7CB92
1 changed files with 3 additions and 1 deletions

View File

@ -14,9 +14,11 @@ def main():
for line in lines:
if line == '' or line.startswith('#'):
continue
domain = line.split('/')[1]
domain = line.split('/')[1].lower()
labels = domain.split('.')
labels.reverse()
if domain in data:
print(f"Redundant found: {domain}")
data[domain] = labels
domains = list(data.keys())
domains.sort(key=lambda k: len(data[k]))