mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 08:36:33 +08: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user