Add lsb() overload

Helper to find least significant bit relative to
the given color.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Gary Linscott
2013-08-28 09:35:04 +02:00
committed by Marco Costalba
parent e6482b7d97
commit aecdbfc4a0
3 changed files with 10 additions and 17 deletions

View File

@@ -319,4 +319,9 @@ 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);
}
#endif // #ifndef BITBOARD_H_INCLUDED