]> git.sesse.net Git - stockfish/commit
Don't copy a full Position object in print()
authorMarco Costalba <mcostalba@gmail.com>
Sun, 21 Oct 2012 22:53:17 +0000 (00:53 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 21 Oct 2012 22:55:16 +0000 (00:55 +0200)
commit5fc8b27db9a1d9fffeb46d0e2ef40803c55fd4f9
treebe43204b8520e785dc486922b96ec2923206b99c
parentdbbbd3880cc13ee5cf07390fbe1be07121abe613
Don't copy a full Position object in print()

Function move_to_san() requires the Position to be
passed by referenced because a do/undo move is done
inside the function to detect a possible mate and to
add to the san string the corresponding '#' suffix.

Instead of passing a copy of current position pass
directly the original position object after const
casting it. This has the advantage to avoid a costly
Position copy, on the down side a bench test could
report different searched nodes if print(move) is
used, due to the additionals do_move() calls.

No functional change.
src/position.cpp