aboutsummaryrefslogtreecommitdiff
path: root/src/grossmeister/evaluation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/grossmeister/evaluation.rs')
-rw-r--r--src/grossmeister/evaluation.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/grossmeister/evaluation.rs b/src/grossmeister/evaluation.rs
index 6669545..b78c49a 100644
--- a/src/grossmeister/evaluation.rs
+++ b/src/grossmeister/evaluation.rs
@@ -190,7 +190,7 @@ impl Grossmeister {
}
_ => panic!("Unreachable")
};
- total + bitboard.serialize().iter().fold(0., |acc, &square| {
+ total + bitboard.serialize().fold(0., |acc, square| {
let pst_index = match color {
Color::White => square.mirror(),
Color::Black => square,
@@ -280,8 +280,8 @@ impl Grossmeister {
Color::White => self.board.piece_sets[Piece::PawnBlack as usize],
};
- let pawn_attacked_squares = opponent_pawns.serialize().iter().fold(0u64, |acc, square| {
- acc | self.board.attacks.pawn[color.flip() as usize][*square as usize]
+ let pawn_attacked_squares = opponent_pawns.serialize().fold(0u64, |acc, square| {
+ acc | self.board.attacks.pawn[color.flip() as usize][square as usize]
});
// Exclude squares controlled by enemy pawns from mobility
@@ -325,7 +325,6 @@ impl Grossmeister {
if *piece == king_home_position.to_bitboard() {
for rook_square in player_pieces[Piece::Rook as usize]
.serialize()
- .iter()
.filter(|rook_square| rook_square.rank() == king_home_position.rank())
{
match rook_square.file() {