projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
b54bcfd
)
Simplify generate_castling (#1885)
author
protonspring
<mike@whiteley.org>
Sun, 23 Dec 2018 15:05:24 +0000 (08:05 -0700)
committer
Marco Costalba
<mcostalba@users.noreply.github.com>
Sun, 23 Dec 2018 15:05:24 +0000 (16:05 +0100)
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
patch
|
blob
|
history
diff --git
a/src/movegen.cpp
b/src/movegen.cpp
index
b4a9d27
..
76a27d9
100644
(file)
--- 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;