mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-16 23:26:23 +08:00
Cleanup piece_attacks_square() functions
Most of them are not required to be public and are used in one place only so remove them and use its definitions. Also rename piece_attacks_square() in piece_attacks() to be aligned to the current naming policy. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -557,7 +557,7 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) {
|
||||
}
|
||||
|
||||
// Luckly we can handle all the other pieces in one go
|
||||
return ( pos.piece_attacks_square(pos.piece_on(from), from, to)
|
||||
return ( bit_is_set(pos.piece_attacks(pc, from), to)
|
||||
&& pos.pl_move_is_legal(m, pinned)
|
||||
&& !move_is_promotion(m));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user