Skip to content

Commit

Permalink
improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Nov 15, 2024
1 parent b3c937b commit 6ad04db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dnstapir/dns/mozpsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ def insert(self, array: list[str], nlbl: int, icann: bool) -> None:

def search(self, key: list[str]) -> tuple[int, int]:
"""Search Trie"""
core = 0
pcore = 0
current = self.root
for label in key:
if current.icann:
if current.icann is True:
core = current.count
else:
elif current.icann is False:
pcore = current.count
# # If current.icann is None, do not update core or pcore
if label not in current.children:
if current.count != 0:
break
Expand Down

0 comments on commit 6ad04db

Please sign in to comment.