]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Be sure to read options before to call trace_evaluate()
[stockfish] / src / search.cpp
index 5a0af8f82a0700cea2a8515b414d823b8e9ae3e9..3f367d83bd0218fed704ad6d720d3c0eb2c9a2a9 100644 (file)
@@ -643,8 +643,7 @@ namespace {
 
         // Start with a small aspiration window and, in case of fail high/low,
         // research with bigger window until not failing high/low anymore.
-        while (true)
-        {
+        do {
             // Search starting from ss+1 to allow calling update_gains()
             value = search<PV, false, true>(pos, ss+1, alpha, beta, depth * ONE_PLY, 0);
 
@@ -680,7 +679,8 @@ namespace {
             }
             else
                 break;
-        }
+
+        } while (abs(value) < VALUE_KNOWN_WIN);
 
         // Collect info about search result
         bestMove = Rml[0].pv[0];