]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Don't uselessy share rootDepth
[stockfish] / src / search.cpp
index e6c3cd701485947c1c174b98f037661dca03409e..09e3c4fa979efd0620d021e14daacbb51ea8034c 100644 (file)
@@ -360,9 +360,9 @@ void Thread::search() {
   multiPV = std::min(multiPV, rootMoves.size());
 
   // Iterative deepening loop until requested to stop or the target depth is reached
-  while (   (rootDepth = rootDepth + ONE_PLY) < DEPTH_MAX
+  while (   (rootDepth += ONE_PLY) < DEPTH_MAX
          && !Signals.stop
-         && (!Limits.depth || Threads.main()->rootDepth / ONE_PLY <= Limits.depth))
+         && !(Limits.depth && mainThread && rootDepth / ONE_PLY > Limits.depth))
   {
       // Distribute search depths across the threads
       if (idx)