Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2567

No functional change.
This commit is contained in:
Joost VandeVondele
2020-03-14 17:04:50 +01:00
parent ec2002c594
commit ddcbacd04d
8 changed files with 30 additions and 29 deletions

View File

@@ -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);
}