X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=e0e2fe64545ececedd4acf53852b9fd7e3b7dbf0;hp=bc3ed87b623dab6ae9debb5d89a48df9e3ee68ee;hb=aecdbfc4a000c72fcc2642f54ce83967913a16ba;hpb=e6482b7d97a6620cebdd569cce575d42ed80c871 diff --git a/src/bitboard.h b/src/bitboard.h index bc3ed87b..e0e2fe64 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -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