refocus_tree: clear arena on no root

This commit is contained in:
Simon Gardling 2025-04-22 15:55:21 -04:00
parent ff7cf6cb0d
commit 1ebfeb9f65
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -535,6 +535,8 @@ impl FutureMoves {
/// Rebuilds the Arena based on `self.current_root`, prunes unrelated nodes
fn refocus_tree(&mut self) {
let Some(root) = self.current_root else {
// handle current_root being empty (clear arena and return)
self.arena.clear();
return;
};