From a6c60378136b865f4a07a4ced22fc0484ababd2c Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Wed, 30 Sep 2009 14:38:40 +0200 Subject: [PATCH] Optimize futilityValue calculation Avoid calling evaluate() if we already have the score in TT No functional change. Signed-off-by: Marco Costalba --- src/search.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.39.2