-
Notifications
You must be signed in to change notification settings - Fork 38
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
Dynamic node removal #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this. Looks good in general, just a few nits, and I would prefer more test coverage before merging.
I tried to think about the "node shrinking optimisation" when we remove a node (merging nodes together). |
Hello @ibraheemdev, do you have an idea when you will be able to review the tests I added after your feedback? Thanks! :) |
The changes look good, thanks. I'll try to have this merged as part of 0.8, which should be finished soon. |
@Totodore I think you need to make sure the denormalized params match before doing a removal. Right now |
…into ft-remove-node
@ibraheemdev I have updated the
Also I added some tests but I'll try to add some more as soon as possible. |
737528e
to
6fb68a8
Compare
I think that's fine, an invalid route could never be in the router. Maybe add a note in the documentation that the function also returns
Yes, I think this would be more intuitive behavior. You can just check that the parameter remapping on the final node is equal to the remapping created for the route. |
Done :) |
@ibraheemdev I'm currently working on optimizing the tree after a node removal. It consists of two actions:
These two actions are a bit more difficult to implement and might compromise the tree in case of error. Therefore do you think it is necessary to have them for this PR or it is better to implement this later in another one? |
@Totodore thanks for continuing to work on this. It looks good for now, I'll take a closer look and try to have it merged this weekend. |
Hey @ibraheemdev any knews ? If you don't have the time to review this at the moment, I'll would still be interested to work on these two features:
|
This looks great, thanks! Feel free to open a new PR if you are interested in working on this further, but you can just leave an issue for now describing the optimizations. |
Add a
remove
fn to the radix treeFor the moment this feature consist only of :
value
si taken backRemaining things to do, are:
@ibraheemdev I would like your feedback on the implementation as I don't master radix tree.
Side note: The
Display
implementation is only for testing purposes and can be gated with aCFG(test)
or removed