X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=dcfedcdbe0b05afa14e2c3b6221ee4cfff67ad61;hb=c416133e2fd1b6bb74fda07cd6050227bbe8994a;hp=eb14e861020928bc20c8730202654653f0818832;hpb=2d7a417d0abe2bfeaf4ea752dc4ffeb7d2190acf;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index eb14e861..dcfedcdb 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1001,10 +1001,8 @@ namespace { } // Step 2. Check for aborted search and immediate draw - if (AbortSearch || ThreadsMgr.thread_should_stop(threadID)) - return VALUE_DRAW; - - if (pos.is_draw() || ply >= PLY_MAX - 1) + if ( AbortSearch || ThreadsMgr.thread_should_stop(threadID) + || pos.is_draw() || ply >= PLY_MAX - 1) return VALUE_DRAW; // Step 3. Mate distance pruning @@ -1021,7 +1019,7 @@ namespace { posKey = excludedMove ? pos.get_exclusion_key() : pos.get_key(); tte = TT.retrieve(posKey); - ttMove = (tte ? tte->move() : MOVE_NONE); + ttMove = tte ? tte->move() : MOVE_NONE; // At PV nodes, we don't use the TT for pruning, but only for move ordering. // This is to avoid problems in the following areas: @@ -1030,12 +1028,9 @@ namespace { // * Fifty move rule detection // * Searching for a mate // * Printing of full PV line - if (!PvNode && tte && ok_to_use_TT(tte, depth, beta, ply)) { - // Refresh tte entry to avoid aging - TT.store(posKey, tte->value(), tte->type(), tte->depth(), ttMove, tte->static_value(), tte->static_value_margin()); - + TT.refresh(tte); ss->bestMove = ttMove; // Can be MOVE_NONE return value_from_tt(tte->value(), ply); }