X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmovegen.cpp;h=cc1518a078de7d48064e93cbd23e8ad6b95b54be;hb=c57c71bf5c56665b0339fa983665bdef4bf8a099;hp=3340f65cf10479113d7228d2fbe461dde3e282f4;hpb=5f1843c9cb55afcd3fb1da9e9dc4b0092f25d9f0;p=stockfish diff --git a/src/movegen.cpp b/src/movegen.cpp index 3340f65c..cc1518a0 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -180,10 +180,11 @@ namespace { static_assert(Pt != KING && Pt != PAWN, "Unsupported piece type in generate_moves()"); - const Square* pl = pos.squares(Us); + Bitboard bb = pos.pieces(Us, Pt); + + while (bb) { + Square from = pop_lsb(&bb); - for (Square from = *pl; from != SQ_NONE; from = *++pl) - { if (Checks) { if ( (Pt == BISHOP || Pt == ROOK || Pt == QUEEN)