Skip to content

Commit

Permalink
update parents list on remove (#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev authored Jul 17, 2023
1 parent 0914058 commit c9e45e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tree/taffy_tree/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ impl Taffy {
}
}

if let Some(children) = self.children.get(key) {
for child in children.iter().copied() {
self.parents[child.into()] = None;
}
}

let _ = self.children.remove(key);
let _ = self.parents.remove(key);
let _ = self.nodes.remove(key);
Expand Down

0 comments on commit c9e45e5

Please sign in to comment.