From a10c9632a5733e1b1aec19950bc3fb541762e36f Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 9 Sep 2008 07:37:46 +0200 Subject: [PATCH] Use TT in qsearch Signed-off-by: Marco Costalba --- src/search.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index b750047e..9636ee40 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1299,6 +1299,11 @@ namespace { if (pos.is_draw()) return VALUE_DRAW; + // Transposition table lookup + const TTEntry* tte = TT.retrieve(pos); + if (tte && ok_to_use_TT(tte, depth, beta, ply)) + return value_from_tt(tte->value(), ply); + // Evaluate the position statically: Value staticValue = evaluate(pos, ei, threadID); @@ -1396,6 +1401,9 @@ namespace { assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE); + // Update transposition table + TT.store(pos, value_to_tt(bestValue, ply), depth, MOVE_NONE, VALUE_TYPE_EXACT); + return bestValue; } -- 2.39.2