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:
Marco Costalba
2013-08-30 07:05:25 +02:00
parent 5d90c149b5
commit 14f47c8ac6
3 changed files with 11 additions and 9 deletions

View File

@@ -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