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:
Marco Costalba
2010-01-25 16:22:50 +01:00
parent c5e71f5150
commit d844a75d2c
3 changed files with 8 additions and 7 deletions

View File

@@ -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[]);