We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee3f7b6 commit 22a8c4bCopy full SHA for 22a8c4b
src/movegen.cpp
@@ -180,17 +180,17 @@ namespace {
180
181
Bitboard bb = piecesToMove & pos.pieces(Pt);
182
183
+ if (!bb)
184
+ return moveList;
185
+
186
+ [[maybe_unused]] const Bitboard checkSquares = pos.check_squares(Pt);
187
188
while (bb) {
189
Square from = pop_lsb(&bb);
190
- if (Checks && (Pt == BISHOP || Pt == ROOK || Pt == QUEEN)
- && !(attacks_bb<Pt>(from) & target & pos.check_squares(Pt)))
- continue;
-
191
Bitboard b = attacks_bb<Pt>(from, pos.pieces()) & target;
192
- if (Checks)
193
- b &= pos.check_squares(Pt);
+ if constexpr (Checks)
+ b &= checkSquares;
194
195
while (b)
196
*moveList++ = make_move(from, pop_lsb(&b));
0 commit comments