matchit
matchit copied to clipboard
Node removal optimisation
Currently when a node is removed from the tree there is no mechanism to check for optimisations.
Here is a non-exhaustive list of the possible things to do:
- Rewind the branch and check if nodes can be removed (only one child without value). Stop at the first non-removable node.
- Rewind the branch and check if nodes can be merged together (only one, non-wild child that doesn't have a value).