Make use of assignment operators for 'Bitboard'

This commit is contained in:
Bruno BELANYI 2022-07-29 19:23:10 +02:00
parent a6e8ac06b6
commit 2e410ba104
2 changed files with 5 additions and 5 deletions

View file

@ -140,7 +140,7 @@ impl Direction {
while !board.is_empty() {
board = self.move_board(board);
res = res | board;
res |= board;
if !(board & blockers).is_empty() {
break;
}

View file

@ -18,16 +18,16 @@ pub fn generate_rook_mask(square: Square) -> Bitboard {
let mask = {
let mut mask = Bitboard::EMPTY;
if square.file() != File::A {
mask = mask | File::A.into_bitboard()
mask |= File::A.into_bitboard()
};
if square.file() != File::H {
mask = mask | File::H.into_bitboard()
mask |= File::H.into_bitboard()
};
if square.rank() != Rank::First {
mask = mask | Rank::First.into_bitboard()
mask |= Rank::First.into_bitboard()
};
if square.rank() != Rank::Eighth {
mask = mask | Rank::Eighth.into_bitboard()
mask |= Rank::Eighth.into_bitboard()
};
mask
};