Avoid calculating piece attacks if there aren't
available check sqaures for the given piece.
About 15% of cases. Not a biggie but still something
especially in the middle game where king is well covered
inside his castle.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
return mlist;
Bitboard checkSqs = pos.piece_attacks<Piece>(ksq) & pos.empty_squares();
return mlist;
Bitboard checkSqs = pos.piece_attacks<Piece>(ksq) & pos.empty_squares();
+ if (!checkSqs)
+ return mlist;
+
while (b)
{
Square from = pop_1st_bit(&b);
while (b)
{
Square from = pop_1st_bit(&b);