replace subtree with pruned root (#3576)

no need to remove sibling explicitly
This commit is contained in:
Antioch Peverell 2021-02-24 15:04:18 +00:00 committed by GitHub
parent 57f4592499
commit 7487ffd75b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,9 +236,10 @@ impl PruneList {
loop { loop {
let (parent, sibling) = family(current); let (parent, sibling) = family(current);
if self.is_pruned_root(sibling) { if self.is_pruned_root(sibling) {
self.bitmap.remove(sibling as u32);
current = parent; current = parent;
} else { } else {
// replace the entire subtree with the single pruned root
self.bitmap.remove_range(pmmr::bintree_range(current));
self.bitmap.add(current as u32); self.bitmap.add(current as u32);
break; break;
} }