Cleanup and optimize Position::has_mate_threat()

There is a functional change because we now skip
more moves and because do_move() / undo_move() is
well known to be not reversible we end up with a
change in node count, although there is actually
no change but a bit speed up.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-08-09 11:45:02 +01:00
parent f26e0fec64
commit 252537fd9c
3 changed files with 40 additions and 43 deletions

View File

@@ -1168,7 +1168,7 @@ namespace {
// Expensive mate threat detection (only for PV nodes)
if (PvNode)
mateThreat = pos.has_mate_threat(opposite_color(pos.side_to_move()));
mateThreat = pos.has_mate_threat();
// Initialize a MovePicker object for the current position
MovePicker mp = MovePicker(pos, ttMove, depth, H, ss, (PvNode ? -VALUE_INFINITE : beta));