simplify update_from_board checking of current_root
This commit is contained in:
parent
65ac509fa4
commit
6a00560a8a
@ -250,10 +250,9 @@ impl FutureMoves {
|
|||||||
.arena
|
.arena
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.find(|(_, m)| {
|
.find(|(_, m)| &m.board == board && (m.parent == self.current_root))
|
||||||
&m.board == board && (m.parent == self.current_root) && self.current_root.is_some()
|
.map(|(idx, _)| idx)
|
||||||
})
|
.filter(|_| self.current_root.is_some());
|
||||||
.map(|(idx, _)| idx);
|
|
||||||
|
|
||||||
if let Some(curr_board_idx) = curr_board {
|
if let Some(curr_board_idx) = curr_board {
|
||||||
self.set_root_idx_raw(curr_board_idx);
|
self.set_root_idx_raw(curr_board_idx);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user