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

Should return the same node when we add a duplicated node #99

Closed
jemmali-git opened this issue May 23, 2021 · 2 comments · Fixed by #100
Closed

Should return the same node when we add a duplicated node #99

jemmali-git opened this issue May 23, 2021 · 2 comments · Fixed by #100
Labels

Comments

@jemmali-git
Copy link

jemmali-git commented May 23, 2021

As the title of this issue mention you need to add one line of code, otherwise all the nodes we be removed

if (found) { // duplicated: value already exist on the tree
        found.meta.multiplicity = (found.meta.multiplicity || 1) + 1; // <2>
        newNode = found; // new line to add
      }
@amejiarosario
Copy link
Owner

amejiarosario commented May 24, 2021

Great finding @jemmali-git, thanks for reporting it. It's fixed now!

amejiarosario pushed a commit that referenced this issue May 24, 2021
## [2.7.5](2.7.4...2.7.5) (2021-05-24)

### Bug Fixes

* **bst:** on duplicates values the same node is returned ([d350da8](d350da8)), closes [#99](#99)
@amejiarosario
Copy link
Owner

🎉 This issue has been resolved in version 2.7.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants