mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Simplify generate_castling (#1885)
Although this is a compile-time constant, we stick the castlingSide into a CastlingRight, then pull it out again. This seems unecessarily complex. No functional change.
This commit is contained in:
committed by
Marco Costalba
parent
b54bcfddaa
commit
59d32f8edd
@@ -29,7 +29,7 @@ namespace {
|
||||
ExtMove* generate_castling(const Position& pos, ExtMove* moveList) {
|
||||
|
||||
constexpr CastlingRight Cr = Us | Cs;
|
||||
constexpr bool KingSide = (Cr == WHITE_OO || Cr == BLACK_OO);
|
||||
constexpr bool KingSide = (Cs == KING_SIDE);
|
||||
|
||||
if (pos.castling_impeded(Cr) || !pos.can_castle(Cr))
|
||||
return moveList;
|
||||
|
||||
Reference in New Issue
Block a user