]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Skip evaluate() call after a null move
[stockfish] / src / search.cpp
index 253311ae11c9ff122a4f40db5ab4e3bc07ef81e5..075aa9b4422d01d490e2a1a25196e8befe7d6002 100644 (file)
@@ -1154,6 +1154,11 @@ split_point_start: // At split points actual search starts from here
             if (ss->staticEval == VALUE_NONE || ss->evalMargin == VALUE_NONE) // Due to a race
                 ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);
         }
+        else if ((ss-1)->currentMove == MOVE_NULL)
+        {
+            ss->staticEval = bestValue = -(ss-1)->staticEval;
+            ss->evalMargin = VALUE_ZERO; // Hack, we really don't know the value
+        }
         else
             ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);