mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Simplify move generation (1/2)
STC:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 29792 W: 2611 L: 2545 D: 24636
Ptnml(0-2): 94, 1982, 10659, 2086, 75
https://tests.stockfishchess.org/tests/view/604fe5b62433018de7a38ba8
LTC:
LLR: 2.92 (-2.94,2.94) {-0.75,0.25}
Total: 22040 W: 826 L: 777 D: 20437
Ptnml(0-2): 8, 646, 9664, 693, 9
https://tests.stockfishchess.org/tests/view/604fec892433018de7a38bac
Closes https://github.com/official-stockfish/Stockfish/pull/3399
No functional change
This commit is contained in:
@@ -182,17 +182,12 @@ namespace {
|
|||||||
|
|
||||||
Bitboard bb = piecesToMove & pos.pieces(Pt);
|
Bitboard bb = piecesToMove & pos.pieces(Pt);
|
||||||
|
|
||||||
if (!bb)
|
|
||||||
return moveList;
|
|
||||||
|
|
||||||
[[maybe_unused]] const Bitboard checkSquares = pos.check_squares(Pt);
|
|
||||||
|
|
||||||
while (bb) {
|
while (bb) {
|
||||||
Square from = pop_lsb(&bb);
|
Square from = pop_lsb(&bb);
|
||||||
|
|
||||||
Bitboard b = attacks_bb<Pt>(from, pos.pieces()) & target;
|
Bitboard b = attacks_bb<Pt>(from, pos.pieces()) & target;
|
||||||
if constexpr (Checks)
|
if constexpr (Checks)
|
||||||
b &= checkSquares;
|
b &= pos.check_squares(Pt);
|
||||||
|
|
||||||
while (b)
|
while (b)
|
||||||
*moveList++ = make_move(from, pop_lsb(&b));
|
*moveList++ = make_move(from, pop_lsb(&b));
|
||||||
|
|||||||
Reference in New Issue
Block a user