From daa3ef9148e8a141d2562900924d578d6462ba72 Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Sat, 9 Mar 2024 19:49:59 +0300 Subject: [PATCH] Simplify increaseDepth to boolean expression Non-functional Simplification, maintaining the same logic as before. Big thanks to @peregrineshahin for helping with the code. Passed non-regression bounds: https://tests.stockfishchess.org/tests/view/65ec93860ec64f0526c42375 LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 101088 W: 26196 L: 26047 D: 48845 Ptnml(0-2): 405, 11580, 26473, 11633, 453 closes https://github.com/official-stockfish/Stockfish/pull/5103 No functional change --- src/search.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index f4ec8fb1..a3e53e02 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -464,11 +464,10 @@ void Search::Worker::iterative_deepening() { else threads.stop = true; } - else if (!mainThread->ponder - && mainThread->tm.elapsed(threads.nodes_searched()) > totalTime * 0.506) - threads.increaseDepth = false; else - threads.increaseDepth = true; + threads.increaseDepth = + mainThread->ponder + || mainThread->tm.elapsed(threads.nodes_searched()) <= totalTime * 0.506; } mainThread->iterValue[iterIdx] = bestValue;