X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=c4446fc5d95bd4a6271fca322eb5b75ec8610d91;hp=72530f2e94a1a324ef0c5818a2677c0aed5d543b;hb=095a96b46119ab47f9b56fb00b1831da552fad2a;hpb=72af519e7ff93ca3524f82db1d429002d2d9ea72;ds=inline diff --git a/src/search.cpp b/src/search.cpp index 72530f2e..c4446fc5 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1450,7 +1450,11 @@ namespace { Value bestValue = staticValue; if (bestValue >= beta) + { + // Update transposition table before to leave + TT.store(pos, value_to_tt(bestValue, ply), depth, MOVE_NONE, VALUE_TYPE_EXACT); return bestValue; + } if (bestValue > alpha) alpha = bestValue; @@ -1534,9 +1538,6 @@ 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); - // Update killers only for good check moves Move m = ss[ply].currentMove; if (alpha >= beta && ok_to_history(pos, m)) // Only non capture moves are considered