mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +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:
@@ -129,8 +129,8 @@ const std::string move_to_string(Move move) {
|
||||
return (from == SQ_E1 ? "e1c1" : "e8c8");
|
||||
}
|
||||
str = square_to_string(from) + square_to_string(to);
|
||||
if (move_promotion(move))
|
||||
str += piece_type_to_char(move_promotion(move), false);
|
||||
if (move_is_promotion(move))
|
||||
str += piece_type_to_char(move_promotion_piece(move), false);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user