]> git.sesse.net Git - stockfish/commitdiff
Stop search if only 1 legal move
authorjhellis3 <jhellis3@gmail.com>
Sun, 3 Mar 2013 21:13:05 +0000 (15:13 -0600)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 4 Mar 2013 07:30:55 +0000 (08:30 +0100)
There is no point searching a move that is forced.
It wastes time while allowing computer opponents to
fill hash with 100% accuracy.

[edit: Condition moved together with "easy move" ones]

Bench identical: 4922272

src/search.cpp

index 33fff82deb48a5b402f470c84c05f39eebf8dca8..19ebc5e6eeeb79ef8ce12a3835372b1581edae95 100644 (file)
@@ -452,6 +452,7 @@ namespace {
                 && !stop
                 &&  PVSize == 1
                 && (   (bestMoveNeverChanged && recapture)
                 && !stop
                 &&  PVSize == 1
                 && (   (bestMoveNeverChanged && recapture)
+                    || RootMoves.size() == 1
                     || Time::now() - SearchTime > (TimeMgr.available_time() * 40) / 100))
             {
                 Value rBeta = bestValue - 2 * PawnValueMg;
                     || Time::now() - SearchTime > (TimeMgr.available_time() * 40) / 100))
             {
                 Value rBeta = bestValue - 2 * PawnValueMg;