san.cpp pass position as constant reference

Make a copy of the position when needed instead
of passing as a reference. It is cleaner and
let us to simplify also Position::print()

A small space inflate while there.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2008-11-30 01:25:16 +01:00
parent 9d1e4d041d
commit 08265aef81
3 changed files with 109 additions and 115 deletions
+1 -2
View File
@@ -275,9 +275,8 @@ void Position::print(Move m) const {
std::cout << std::endl;
if (m != MOVE_NONE)
{
Position p(*this);
std::string col = (color_of_piece_on(move_from(m)) == BLACK ? ".." : "");
std::cout << "Move is: " << col << move_to_san(p, m) << std::endl;
std::cout << "Move is: " << col << move_to_san(*this, m) << std::endl;
}
for (Rank rank = RANK_8; rank >= RANK_1; rank--)
{