mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +08:00
Use frontmost_sq() and backmost_sq helpers
Should easier to read than the lsb() / msb() low level functions. No functional change.
This commit is contained in:
@@ -319,9 +319,10 @@ extern Square pop_lsb(Bitboard* b);
|
||||
|
||||
#endif
|
||||
|
||||
/// lsb() overload finds least significant bit relative to the given color
|
||||
inline Square lsb(Color c, Bitboard b) {
|
||||
return c == WHITE ? lsb(b) : msb(b);
|
||||
}
|
||||
/// frontmost_sq() and backmost_sq() find the square corresponding to the
|
||||
/// most/least advanced bit relative to the given color.
|
||||
|
||||
inline Square frontmost_sq(Color c, Bitboard b) { return c == WHITE ? msb(b) : lsb(b); }
|
||||
inline Square backmost_sq(Color c, Bitboard b) { return c == WHITE ? lsb(b) : msb(b); }
|
||||
|
||||
#endif // #ifndef BITBOARD_H_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user