1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00: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:
protonspring 2018-12-23 08:05:24 -07:00 committed by Marco Costalba
parent b54bcfddaa
commit 59d32f8edd

View file

@ -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;