]> git.sesse.net Git - stockfish/commitdiff
Fix the polling frequency when pondering
authorMarco Costalba <mcostalba@gmail.com>
Thu, 8 Oct 2009 08:09:19 +0000 (09:09 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 8 Oct 2009 08:09:19 +0000 (09:09 +0100)
When pondering InfiniteSearch == false but myTime == 0 so that
NodesBetweenPolls = 1000 instead of the standard.

The patch fixes the bug and is more robust because checks
directly myTime for a non-zero value, without relying on
an indirect test (InfiniteSearch in this case).

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 6dd854c68689c6a5c16b767eeaa9686e89e3cf8b..719fc0eac47fc9ac3ccbcf7dc75071670f9fa10b 100644 (file)
@@ -471,11 +471,9 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
       NodesBetweenPolls = Min(MaxNodes, 30000);
       InfiniteSearch = true; // HACK
   }
       NodesBetweenPolls = Min(MaxNodes, 30000);
       InfiniteSearch = true; // HACK
   }
-  else if (InfiniteSearch)
-      NodesBetweenPolls = 30000;
-  else if (myTime < 1000)
+  else if (myTime && myTime < 1000)
       NodesBetweenPolls = 1000;
       NodesBetweenPolls = 1000;
-  else if (myTime < 5000)
+  else if (myTime && myTime < 5000)
       NodesBetweenPolls = 5000;
   else
       NodesBetweenPolls = 30000;
       NodesBetweenPolls = 5000;
   else
       NodesBetweenPolls = 30000;