]> git.sesse.net Git - stockfish/commitdiff
Rewrite TBScore in uci_pv()
authorMarco Costalba <mcostalba@gmail.com>
Wed, 26 Nov 2014 11:56:08 +0000 (12:56 +0100)
committerJoona Kiiski <joona.kiiski@gmail.com>
Sun, 30 Nov 2014 19:35:35 +0000 (19:35 +0000)
Streamline the code and make
it understandable.

No functional change.

Resolves #135

src/search.cpp

index fb9bc17a26232b1d27853cb65e69a0691c07cd72..0005391fd833f2ba5eb5b379f1964686b0450641 100644 (file)
@@ -1444,14 +1444,8 @@ moves_loop: // When in check and at SpNode search starts from here
         Depth d = updated ? depth : depth - ONE_PLY;
         Value v = updated ? RootMoves[i].score : RootMoves[i].prevScore;
 
-        bool tb = RootInTB;
-        if (tb)
-        {
-            if (abs(v) >= VALUE_MATE - MAX_PLY)
-                tb = false;
-            else
-                v = TBScore;
-        }
+        bool tb = RootInTB && abs(v) < VALUE_MATE - MAX_PLY;
+        v = tb ? TBScore : v;
 
         if (ss.rdbuf()->in_avail()) // Not at first line
             ss << "\n";