mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Use constexpr when makes sense
No functional change.
This commit is contained in:
committed by
Marco Costalba
parent
ccd6bad512
commit
28b6a457c2
@@ -126,7 +126,7 @@ inline Bitboard& operator^=(Bitboard& b, Square s) {
|
||||
return b ^= SquareBB[s];
|
||||
}
|
||||
|
||||
inline bool more_than_one(Bitboard b) {
|
||||
constexpr bool more_than_one(Bitboard b) {
|
||||
return b & (b - 1);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ inline Bitboard file_bb(Square s) {
|
||||
/// shift() moves a bitboard one step along direction D. Mainly for pawns
|
||||
|
||||
template<Square D>
|
||||
inline Bitboard shift(Bitboard b) {
|
||||
constexpr Bitboard shift(Bitboard b) {
|
||||
return D == NORTH ? b << 8 : D == SOUTH ? b >> 8
|
||||
: D == NORTH_EAST ? (b & ~FileHBB) << 9 : D == SOUTH_EAST ? (b & ~FileHBB) >> 7
|
||||
: D == NORTH_WEST ? (b & ~FileABB) << 7 : D == SOUTH_WEST ? (b & ~FileABB) >> 9
|
||||
|
||||
Reference in New Issue
Block a user