simplify FutureMoves::move_history

This commit is contained in:
Simon Gardling 2025-04-22 15:52:17 -04:00
parent 9fff000746
commit 693b5c1f7c
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -331,7 +331,7 @@ impl FutureMoves {
} }
fn move_history(&self, idx: usize) -> Option<Vec<(MoveCoord, Piece)>> { fn move_history(&self, idx: usize) -> Option<Vec<(MoveCoord, Piece)>> {
if let Some(root) = self.current_root { self.current_root.and_then(|root| {
let mut hist = Vec::new(); let mut hist = Vec::new();
let mut current = Some(idx); let mut current = Some(idx);
@ -351,9 +351,7 @@ impl FutureMoves {
} }
Some(hist) Some(hist)
} else { })
None
}
} }
fn get_board_from_idx(&self, idx: usize) -> Option<Board> { fn get_board_from_idx(&self, idx: usize) -> Option<Board> {