From 59d32f8eddf4fc8138f419777fbabf58080f1caa Mon Sep 17 00:00:00 2001 From: protonspring Date: Sun, 23 Dec 2018 08:05:24 -0700 Subject: [PATCH] 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. --- src/movegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/movegen.cpp b/src/movegen.cpp index b4a9d27b..76a27d9f 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -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; -- 2.39.2