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:
@@ -517,7 +517,7 @@ namespace {
|
||||
|
||||
assert(b);
|
||||
|
||||
if (!(b & (b - 1)) && (b & pos.pieces(Them)))
|
||||
if (single_bit(b) && (b & pos.pieces(Them)))
|
||||
score += ThreatBonus[Piece][type_of(pos.piece_on(first_1(b)))] / 2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user