Skip to content
This repository was archived by the owner on Apr 4, 2020. It is now read-only.
This repository was archived by the owner on Apr 4, 2020. It is now read-only.

Removing nodes does not compact the IDs #12

Description

@funforums

Hi all,

It seems to me that the removing a node from the tree does not adjust the IDs of the nodes. This would be okay, if only adding a child to a node did not use length as a value for the ID of a new node being created.

E.G.
root with 3 children, (A,B,C)
ID A: 0/0
ID B: 0/1
ID C: 0/2
length:3

Calling B.remove() will leave the tree in this state

root with 2 children, (A,C)
ID A: 0/0
ID C: 0/2
length:2

Adding a new node D:
root with 3 children, (A,C,D)
ID A: 0/0
ID C: 0/2
ID D: 0/2
length:3

This results in element D disappearing from iterations over the tree.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions