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

@@ -264,8 +264,8 @@ public:
bool is_mate() const;
bool is_draw() const;
// Check if one side threatens a mate in one
bool has_mate_threat(Color c);
// Check if side to move could be mated in one
bool has_mate_threat();
// Number of plies since the last non-reversible move
int rule_50_counter() const;