mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Micro optimize and rename move_promotion()
Rename to move_is_promotion() to be more clear, also add a new function move_promotion_piece() to get the promotion piece type in the few places where is needed. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -78,10 +78,14 @@ inline Square move_to(Move m) {
|
||||
return Square(m & 0x3F);
|
||||
}
|
||||
|
||||
inline PieceType move_promotion(Move m) {
|
||||
inline PieceType move_promotion_piece(Move m) {
|
||||
return PieceType((int(m) >> 12) & 7);
|
||||
}
|
||||
|
||||
inline int move_is_promotion(Move m) {
|
||||
return m & (7 << 12);
|
||||
}
|
||||
|
||||
inline int move_is_ep(Move m) {
|
||||
return m & (1 << 15);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user