1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 03:29:14 +00:00

Micro optimize generate_piece_checks()

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>
This commit is contained in:
Marco Costalba 2009-04-18 16:21:44 +01:00
parent de050db2b0
commit a52ab2afbf

View file

@ -815,6 +815,9 @@ namespace {
return mlist;
Bitboard checkSqs = pos.piece_attacks<Piece>(ksq) & pos.empty_squares();
if (!checkSqs)
return mlist;
while (b)
{
Square from = pop_1st_bit(&b);