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:
parent
de050db2b0
commit
a52ab2afbf
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue