future_move: improve pruning logic
This commit is contained in:
parent
9757264854
commit
f10f4d83e0
@ -480,9 +480,16 @@ impl FutureMoves {
|
||||
}
|
||||
|
||||
for idx in indexes {
|
||||
// TODO! add check here to make sure that this index is
|
||||
// still connected to the root from the previous trimming
|
||||
// steps
|
||||
// any nodes that have no parent node and aren't
|
||||
// the root node, is orphaned
|
||||
if self.arena[idx].parent.is_none() && self.current_root != Some(idx) {
|
||||
// propegate orphan-ness to the children
|
||||
let children: Vec<usize> = self.arena[idx].children.drain(..).collect();
|
||||
for idx in children {
|
||||
self.arena[idx].parent = None;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut m = self.arena[idx].clone();
|
||||
// don't attempt and trim moves that have already been trimmed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user