Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Map for TrieNode children #27

Merged
merged 1 commit into from
May 29, 2018
Merged

Use Map for TrieNode children #27

merged 1 commit into from
May 29, 2018

Conversation

caub
Copy link
Contributor

@caub caub commented May 28, 2018

Map are more suitable and efficient for dynamically shaped hashes (quick benchmark)

@codecov-io
Copy link

codecov-io commented May 28, 2018

Codecov Report

Merging #27 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #27   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          78     78           
  Lines        1625   1623    -2     
  Branches      289    288    -1     
=====================================
- Hits         1625   1623    -2
Impacted Files Coverage Δ
src/data-structures/trie/TrieNode.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30ae323...8e288e2. Read the comment docs.

@trekhleb
Copy link
Owner

@caub
Thank you for submission! The code looks much cleaner with using Map() and that is nice.
But could you please revert your changes in package-lock.json? Seems like they are not relevant, aren't they?

@caub
Copy link
Contributor Author

caub commented May 28, 2018

done
There's one thing slower with Map though, it's [...map.keys()] vs Object.keys(obj), but I think .suggestChildren is not used too often

@trekhleb
Copy link
Owner

Great! Thank you for contribution!

@trekhleb trekhleb merged commit b1a613e into trekhleb:master May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants