shardtree: Do not unify pruned nodes with empty nodes.

This commit is contained in:
Kris Nuttycombe 2024-05-28 19:11:09 -06:00
parent 7e48886fd3
commit d40e178f8d
1 changed files with 0 additions and 2 deletions

View File

@ -315,8 +315,6 @@ impl<H: Hashable + Clone + PartialEq> PrunableTree<H> {
pub(crate) fn unite(level: Level, ann: Option<Arc<H>>, left: Self, right: Self) -> Self {
match (left, right) {
(Tree(Node::Nil), Tree(Node::Nil)) => Tree(Node::Nil),
(Tree(Node::Nil | Node::Pruned), Tree(Node::Pruned)) => Tree(Node::Pruned),
(Tree(Node::Pruned), Tree(Node::Nil)) => Tree(Node::Pruned),
(Tree(Node::Leaf { value: lv }), Tree(Node::Leaf { value: rv }))
// we can prune right-hand leaves that are not marked or reference leaves; if a
// leaf is a checkpoint then that information will be propagated to the replacement