mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-27 04:26:24 +08:00
Avoid copy a Position to get a move's san notation
In move_to_san() we create by copy a new position just to detect if move gives check. This could be very costly in line_to_san() that calls move_to_san() for every move, so create the position only once and pass a reference to move_to_san() No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
//// Prototypes
|
||||
////
|
||||
|
||||
extern const std::string move_to_san(const Position& pos, Move m);
|
||||
extern const std::string move_to_san(Position& pos, Move m);
|
||||
extern Move move_from_san(const Position& pos, const std::string& str);
|
||||
extern const std::string line_to_san(const Position& pos, Move line[], int startColumn, bool breakLines);
|
||||
extern const std::string pretty_pv(const Position& pos, int time, int depth, uint64_t nodes, Value score, ValueType type, Move pv[]);
|
||||
|
||||
Reference in New Issue
Block a user