]> git.sesse.net Git - stockfish/commitdiff
Simplify StatSCore Initialization
authormckx00 <mckx00@gmail.com>
Mon, 14 Sep 2020 02:28:32 +0000 (19:28 -0700)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 15 Sep 2020 05:19:02 +0000 (07:19 +0200)
No need to initialize StatScore at rootNode. Current Logic is redundant because at subsequent levels the grandchildren statScore is initialized to zero.

closes https://github.com/official-stockfish/Stockfish/pull/3122

Non functional change.

src/search.cpp

index 4aeadc28a7802c506309091f8371ad92715d7bf9..07c491b69f487faae35f5aa07469c864a3263ebb 100644 (file)
@@ -654,9 +654,7 @@ namespace {
     // starts with statScore = 0. Later grandchildren start with the last calculated
     // statScore of the previous grandchild. This influences the reduction rules in
     // LMR which are based on the statScore of parent position.
     // starts with statScore = 0. Later grandchildren start with the last calculated
     // statScore of the previous grandchild. This influences the reduction rules in
     // LMR which are based on the statScore of parent position.
-    if (rootNode)
-        (ss+4)->statScore = 0;
-    else
+    if (!rootNode)
         (ss+2)->statScore = 0;
 
     // Step 4. Transposition table lookup. We don't want the score of a partial
         (ss+2)->statScore = 0;
 
     // Step 4. Transposition table lookup. We don't want the score of a partial