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