1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

Optimize futilityValue calculation

Avoid calling evaluate() if we already have the score in TT

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2009-09-30 14:38:40 +02:00
parent e677185567
commit a6c6037813

View 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