From bab1cc300cbf1929fe42bdbce786a22dd97c8e1b Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Tue, 26 Dec 2023 20:27:45 +0300 Subject: [PATCH] Refactor bestvalue adjustment in qsearch closes https://github.com/official-stockfish/Stockfish/pull/4935 No functional change --- AUTHORS | 2 +- src/search.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index cedee2f3536..28586eec974 100644 --- a/AUTHORS +++ b/AUTHORS @@ -72,7 +72,7 @@ Fabian Beuke (madnight) Fabian Fichter (ianfab) Fanael Linithien (Fanael) fanon -Fauzi Akram Dabat (FauziAkram) +Fauzi Akram Dabat (fauzi2) Felix Wittmann gamander Gabriele Lombardo (gabe) diff --git a/src/search.cpp b/src/search.cpp index bc196ec4f50..7709af35a02 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1616,8 +1616,8 @@ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) { return mated_in(ss->ply); // Plies to mate from the root } - if (std::abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY) - bestValue = bestValue >= beta ? (3 * bestValue + beta) / 4 : bestValue; + if (std::abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY && bestValue >= beta) + bestValue = (3 * bestValue + beta) / 4; // Save gathered info in transposition table tte->save(posKey, value_to_tt(bestValue, ss->ply), pvHit,