mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Introduce single_bit() helper
Self-documenting code instead of a tricky bitwise tweak, not known by everybody. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -1351,7 +1351,7 @@ split_point_start: // At split points actual search starts from here
|
||||
// Rule 1. Checks which give opponent's king at most one escape square are dangerous
|
||||
b = kingAtt & ~pos.pieces(them) & ~newAtt & ~(1ULL << to);
|
||||
|
||||
if (!(b && (b & (b - 1))))
|
||||
if (single_bit(b)) // Catches also !b
|
||||
return true;
|
||||
|
||||
// Rule 2. Queen contact check is very dangerous
|
||||
|
||||
Reference in New Issue
Block a user