mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 10:36:26 +08:00
Small cleanups
closes https://github.com/official-stockfish/Stockfish/pull/2567 No functional change.
This commit is contained in:
@@ -375,14 +375,17 @@ inline Square msb(Bitboard b) {
|
||||
/// pop_lsb() finds and clears the least significant bit in a non-zero bitboard
|
||||
|
||||
inline Square pop_lsb(Bitboard* b) {
|
||||
assert(*b);
|
||||
const Square s = lsb(*b);
|
||||
*b &= *b - 1;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/// frontmost_sq() returns the most advanced square for the given color
|
||||
/// frontmost_sq() returns the most advanced square for the given color,
|
||||
/// requires a non-zero bitboard.
|
||||
inline Square frontmost_sq(Color c, Bitboard b) {
|
||||
assert(b);
|
||||
return c == WHITE ? msb(b) : lsb(b);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user