Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2628

No functional change
This commit is contained in:
Joost VandeVondele
2020-04-29 17:39:25 +02:00
parent 4776dc0e12
commit 353e20674b
6 changed files with 17 additions and 15 deletions

View File

@@ -269,7 +269,7 @@ inline bool Position::can_castle(CastlingRights cr) const {
}
inline int Position::castling_rights(Color c) const {
return st->castlingRights & (c == WHITE ? WHITE_CASTLING : BLACK_CASTLING);
return c & CastlingRights(st->castlingRights);
}
inline bool Position::castling_impeded(CastlingRights cr) const {