mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 08:36:33 +08:00
Micro-optimize castling handling in do_move()
And better self-document the code. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -59,7 +59,7 @@ const string move_to_uci(Move m, bool chess960) {
|
||||
return from == SQ_E1 ? "e1c1" : "e8c8";
|
||||
|
||||
if (move_is_promotion(m))
|
||||
promotion = char(tolower(piece_type_to_char(move_promotion_piece(m))));
|
||||
promotion = char(tolower(piece_type_to_char(promotion_piece_type(m))));
|
||||
|
||||
return square_to_string(from) + square_to_string(to) + promotion;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ const string move_to_san(Position& pos, Move m) {
|
||||
if (move_is_promotion(m))
|
||||
{
|
||||
san += '=';
|
||||
san += piece_type_to_char(move_promotion_piece(m));
|
||||
san += piece_type_to_char(promotion_piece_type(m));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user