]> git.sesse.net Git - stockfish/commitdiff
Lookup TT for eval also in PV nodes
authorMarco Costalba <mcostalba@gmail.com>
Sat, 8 May 2010 12:12:46 +0000 (13:12 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 8 May 2010 12:12:46 +0000 (13:12 +0100)
We don't need to evaluate the position if it
is already cached in TT. We already do this
in non-PV case.

No functional change.

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

index 669302fcfa22997feaae32bf4f196fc077f64195..aa577c79b7c4fdc2eab25bb2663170defb68e91f 100644 (file)
@@ -1025,8 +1025,8 @@ namespace {
   // search<>() is the main search function for both PV and non-PV nodes
 
   template <NodeType PvNode>
-  Value search(Position& pos, SearchStack ss[], Value alpha, Value beta,
-               Depth depth, int ply, bool allowNullmove, int threadID, Move excludedMove) {
+  Value search(Position& pos, SearchStack ss[], Value alpha, Value beta, Depth depth,
+               int ply, bool allowNullmove, int threadID, Move excludedMove) {
 
     assert(alpha >= -VALUE_INFINITE && alpha <= VALUE_INFINITE);
     assert(beta > alpha && beta <= VALUE_INFINITE);
@@ -1098,7 +1098,7 @@ namespace {
     isCheck = pos.is_check();
     if (!isCheck)
     {
-        if (!PvNode && tte && (tte->type() & VALUE_TYPE_EVAL))
+        if (tte && (tte->type() & VALUE_TYPE_EVAL))
             ss[ply].eval = value_from_tt(tte->value(), ply);
         else
             ss[ply].eval = evaluate(pos, ei, threadID);