mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00: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:
+1
-2
@@ -379,8 +379,7 @@ Bitboard Position::hidden_checkers() const {
|
||||
{
|
||||
b = squares_between(ksq, pop_1st_bit(&pinners)) & occupied_squares();
|
||||
|
||||
// Only one bit set and is an our piece?
|
||||
if (b && !(b & (b - 1)) && (b & pieces(sideToMove)))
|
||||
if (b && single_bit(b) && (b & pieces(sideToMove)))
|
||||
result |= b;
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user