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

add remove method to Trie #553

Merged
merged 5 commits into from
Oct 24, 2023
Merged

add remove method to Trie #553

merged 5 commits into from
Oct 24, 2023

Conversation

phryneas
Copy link
Collaborator

@phryneas phryneas commented Oct 4, 2023

This adds a remove (and removeArray) method to Trie.

It aims for removing a child Trie's data property, and going from there, all empty child trees from their respective parent.

If a WeakMap is encountered on any Trie, removal will be aborted, as it cannot be said safely if that WeakMap is empty or contains values.

Copy link
Owner

@benjamn benjamn left a comment

Choose a reason for hiding this comment

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

Looks good to me (with a few refactorings)!

@benjamn benjamn merged commit eac12a1 into benjamn:main Oct 24, 2023
5 checks passed
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.

2 participants