Skip to content

Commit

Permalink
Use TT in qsearch
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
  • Loading branch information
mcostalba committed Sep 9, 2008
1 parent bc4e937 commit a10c963
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit a10c963

Please sign in to comment.