Skip to content

Refactor Trie __init__, reduce complexity - #382

Merged
bact merged 5 commits into
devfrom
refactor-trie
May 5, 2020
Merged

Refactor Trie __init__, reduce complexity#382
bact merged 5 commits into
devfrom
refactor-trie

Conversation

@bact

@bact bact commented May 4, 2020

Copy link
Copy Markdown
Member

This PR will close #381

@bact bact added the refactoring a technical improvement which does not add any new features or change existing features. label May 4, 2020
@bact bact added this to the 2.2 milestone May 4, 2020
@pep8speaks

pep8speaks commented May 4, 2020

Copy link
Copy Markdown

Hello @bact! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-05-04 18:41:29 UTC

@coveralls

coveralls commented May 4, 2020

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 91.099% when pulling 3faa0cc on refactor-trie into b329aa8 on dev.

@korakot korakot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to leave Trie.Node.add(..) the same.

You could add another Trie.add_word(..) instead.

@bact

bact commented May 4, 2020

Copy link
Copy Markdown
Member Author

I prefer to leave Trie.Node.add(..) the same.

You could add another Trie.add_word(..) instead.

Maybe better that way. So we can add new word after the trie has been created, if needed.

@bact bact left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed accordingly.

I keep the method name add() for brevity.
Also add len() to Trie.

@bact bact self-assigned this May 5, 2020
@bact
bact merged commit 831a9fc into dev May 5, 2020
@bact
bact deleted the refactor-trie branch May 6, 2020 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring a technical improvement which does not add any new features or change existing features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce Trie __init__ complexity

4 participants