Skip to content

Commit

Permalink
Merge pull request #650 from enzbang/ramonat-fix-trie-type-error
Browse files Browse the repository at this point in the history
Modify Trie code to avoid a mypy error
  • Loading branch information
Nikokrock authored Oct 31, 2023
2 parents 7f5765c + 527dc1d commit e4d01e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/e3/collection/trie.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ def match(self, word: str, delimiter: str | None = None) -> bool:
if self.END_MARKER in cursor and (not delimiter or letter in delimiter):
return True
else:
cursor = cursor.get(letter, None)
if cursor is None:
new_cursor = cursor.get(letter, None)
if new_cursor is None:
return False
else:
cursor = new_cursor

return self.END_MARKER in cursor

0 comments on commit e4d01e6

Please sign in to comment.