fix: don't adjust parent tree's stack size when composting
This commit is contained in:
parent
912aca2a89
commit
2252be416e
|
@ -234,7 +234,14 @@ fn main() -> io::Result<()> {
|
||||||
let tree = trees.remove(&tree_id).unwrap();
|
let tree = trees.remove(&tree_id).unwrap();
|
||||||
(tree.parent_id, tree.stack_size)
|
(tree.parent_id, tree.stack_size)
|
||||||
};
|
};
|
||||||
let parent = trees.get_mut(&parent_id).unwrap();
|
|
||||||
|
// One tree is "its own" parent, namely, the seed tree, in which
|
||||||
|
// case this `get_mut` will return None
|
||||||
|
let parent = match trees.get_mut(&parent_id) {
|
||||||
|
Some(p) => p,
|
||||||
|
None => continue
|
||||||
|
};
|
||||||
|
|
||||||
parent.stack_size += recovered_stack_size;
|
parent.stack_size += recovered_stack_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue