mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Simplify newly introduced castling_is_check()
Use bit_is_set() instead of open coding. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
76381cbd69
commit
1156eb865b
1 changed files with 2 additions and 3 deletions
|
@ -945,11 +945,10 @@ namespace {
|
|||
File rookFile = (side == QUEEN_SIDE ? FILE_D : FILE_F);
|
||||
Color us = pos.side_to_move();
|
||||
Square ksq = pos.king_square(us);
|
||||
Bitboard occ = pos.occupied_squares(), oppKingBB = EmptyBoardBB;
|
||||
Bitboard occ = pos.occupied_squares();
|
||||
|
||||
set_bit(&oppKingBB, pos.king_square(opposite_color(us)));
|
||||
clear_bit(&occ, ksq); // Remove our king from the board
|
||||
Square rsq = make_square(rookFile, square_rank(ksq));
|
||||
return (rook_attacks_bb(rsq, occ) & oppKingBB);
|
||||
return bit_is_set(rook_attacks_bb(rsq, occ), pos.king_square(opposite_color(us)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue