mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 03:57:45 +00:00
Templetize sliding attacks
No functional change and no speed regression, it seems to be even a bit faster on MSVC and gcc. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+2
-3
@@ -345,10 +345,9 @@ inline Square Position::castle_rook_square(CastleRight f) const {
|
||||
|
||||
template<PieceType Pt>
|
||||
inline Bitboard Position::attacks_from(Square s) const {
|
||||
return Pt == BISHOP ? bishop_attacks_bb(s, occupied_squares())
|
||||
: Pt == ROOK ? rook_attacks_bb(s, occupied_squares())
|
||||
return Pt == BISHOP || Pt == ROOK ? attacks_bb<Pt>(s, occupied_squares())
|
||||
: Pt == QUEEN ? attacks_from<ROOK>(s) | attacks_from<BISHOP>(s)
|
||||
: StepAttacksBB[Pt][s];
|
||||
: StepAttacksBB[Pt][s];
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
Reference in New Issue
Block a user