allocator optimizations

This commit is contained in:
2025-02-10 01:33:21 -05:00
parent 598c38efd6
commit 3d3eb01143
5 changed files with 41 additions and 50 deletions

View File

@@ -58,7 +58,6 @@ struct FutureMoves {
max_depth: usize,
/// Color w.r.t
agent_color: Piece,
gc: usize,
}
impl FutureMoves {
@@ -69,7 +68,6 @@ impl FutureMoves {
current_depth: 0,
max_depth,
agent_color,
gc: 0,
}
}
@@ -205,10 +203,7 @@ impl FutureMoves {
if let Some(root) = new_root {
self.current_root = Some(root);
self.current_depth = self.max_depth - self.depth_of(Some(root));
self.gc += 1;
if self.gc > 3 {
self.prune_unrelated();
}
self.prune_unrelated();
true
} else {
false