From 37a6862dda9af1e57cb8c9a33353c3ef36c36a13 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 6 Apr 2024 12:27:01 +0100 Subject: [PATCH] Remove redundant 'is_capture' --- src/board/chess_board/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/board/chess_board/mod.rs b/src/board/chess_board/mod.rs index 2b1d5cb..c9ec565 100644 --- a/src/board/chess_board/mod.rs +++ b/src/board/chess_board/mod.rs @@ -145,7 +145,6 @@ impl ChessBoard { #[inline(always)] pub fn play_move_inplace(&mut self, chess_move: Move) -> NonReversibleState { let opponent = !self.current_player(); - let is_capture = !(self.combined_occupancy() & chess_move.destination()).is_empty(); let move_piece = Piece::iter() .find(|&p| !(self.piece_occupancy(p) & chess_move.start()).is_empty()) .unwrap(); @@ -165,7 +164,7 @@ impl ChessBoard { }; // Non-revertible state modification - if is_capture || move_piece == Piece::Pawn { + if captured_piece.is_some() || move_piece == Piece::Pawn { self.half_move_clock = 0; } else { self.half_move_clock += 1;