]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Simplify generate_castling (#1885)
[stockfish] / src / movegen.cpp
index b4a9d27ba1d7459fcc959ba30fc4fe88a84a6a1b..76a27d9f4936320165c0378f2b59225038b0abbe 100644 (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;