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

Fix removal of complex subtrees #72

Merged
merged 1 commit into from
May 17, 2021

Commits on May 16, 2021

  1. Fix removal of complex subtrees

    Previous code had incorrect preorder traversal in
    NodeId::remove_subtree. Upon return upwards in the tree, if a cursor's
    parent didn't have a sibling, the algorithm would terminate without
    looking at more distant ancestors which still might have some siblings
    that needed removing.
    
    In the following example arena, when removing node 1_2, node 1_2_2
    should be marked as removed but it wasn't:
    
        arena
        `-- 1
            |-- 1_1
            |-- 1_2
            |   |-- 1_2_1
            |   |   `-- 1_2_1_1
            |   |       `-- 1_2_1_1_1
            |   `-- 1_2_2
            `-- 1_3
    
    This issue with returning upwards in ancestors chain is now fixed. A
    new test case is added with the above example scenario.
    
    Resolves: saschagrunert#71
    jistr committed May 16, 2021
    Configuration menu
    Copy the full SHA
    e59a038 View commit details
    Browse the repository at this point in the history