Move to what we already do in generate_piece_moves()
This simple patch gives a spped up of 1.4% !!
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
int mob;
File f;
Color them = opposite_color(us);
+ const Square* ptr = pos.piece_list_begin(us, Piece);
- for (int i = 0, e = pos.piece_count(us, Piece); i < e; i++)
+ while ((s = *ptr++) != SQ_NONE)
{
- s = pos.piece_list(us, Piece, i);
-
if (Piece == KNIGHT || Piece == QUEEN)
b = pos.attacks_from<Piece>(s);
else if (Piece == BISHOP)