]> git.sesse.net Git - stockfish/commitdiff
Optimize futilityValue calculation
authorMarco Costalba <mcostalba@gmail.com>
Wed, 30 Sep 2009 12:38:40 +0000 (14:38 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 30 Sep 2009 15:11:41 +0000 (16:11 +0100)
Avoid calling evaluate() if we already have the score in TT

No functional change.

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

index 58b60c878d872f986157e84a823386a40b33a0d5..b513871a2fa2820004ea719ed2dec82c015857cd 100644 (file)
@@ -1333,6 +1333,10 @@ namespace {
     bool useFutilityPruning =   depth < SelectiveDepth
                              && !isCheck;
 
+    // Avoid calling evaluate() if we already have the score in TT
+    if (tte && (tte->type() & VALUE_TYPE_EVAL))
+        futilityValue = value_from_tt(tte->value(), ply) + FutilityMargins[int(depth) - 2];
+
     // Loop through all legal moves until no moves remain or a beta cutoff
     // occurs.
     while (   bestValue < beta