static_assert(Pt != KING && Pt != PAWN, "Unsupported piece type in generate_moves()");
- const Square* pl = pos.squares<Pt>(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)