From: Marco Costalba Date: Wed, 30 Sep 2009 12:38:40 +0000 (+0200) Subject: Optimize futilityValue calculation X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a6c60378136b865f4a07a4ced22fc0484ababd2c;hp=e677185567173a0b50f0ca47bd2496c5f814dab4;ds=sidebyside Optimize futilityValue calculation Avoid calling evaluate() if we already have the score in TT No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 58b60c87..b513871a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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