From 7487ffd75b2c69e15141648a3ea064c049fc5daa Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Wed, 24 Feb 2021 15:04:18 +0000 Subject: [PATCH] replace subtree with pruned root (#3576) no need to remove sibling explicitly --- store/src/prune_list.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/src/prune_list.rs b/store/src/prune_list.rs index 0acb6d9fa..b5c3ebe6d 100644 --- a/store/src/prune_list.rs +++ b/store/src/prune_list.rs @@ -236,9 +236,10 @@ impl PruneList { loop { let (parent, sibling) = family(current); if self.is_pruned_root(sibling) { - self.bitmap.remove(sibling as u32); current = parent; } else { + // replace the entire subtree with the single pruned root + self.bitmap.remove_range(pmmr::bintree_range(current)); self.bitmap.add(current as u32); break; }