X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=afc4a671251b03c196d1d07a565561158f9524df;hp=bf34b77e5d8bd7f8ccbe0177fe4d2ae3da6e5038;hb=96362fe3df141eeead4bdb863d2bb2d891886abf;hpb=8ab12c901258064f1a9bc531477e1b706bc974fb diff --git a/src/search.cpp b/src/search.cpp index bf34b77e..afc4a671 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -455,12 +455,12 @@ void Thread::search() { timeReduction *= 1.25; // Use part of the gained time from a previous stable move for the current move - double unstablePvFactor = 1.0 + mainThread->bestMoveChanges; - unstablePvFactor *= std::pow(mainThread->previousTimeReduction, 0.528) / timeReduction; + double bestMoveInstability = 1.0 + mainThread->bestMoveChanges; + bestMoveInstability *= std::pow(mainThread->previousTimeReduction, 0.528) / timeReduction; // Stop the search if we have only one legal move, or if available time elapsed if ( rootMoves.size() == 1 - || Time.elapsed() > Time.optimum() * unstablePvFactor * improvingFactor / 581) + || Time.elapsed() > Time.optimum() * bestMoveInstability * improvingFactor / 581) { // If we are allowed to ponder do not stop the search now but // keep pondering until the GUI sends "ponderhit" or "stop". @@ -495,7 +495,7 @@ namespace { if (depth < ONE_PLY) return qsearch(pos, ss, alpha, beta); - const bool PvNode = NT == PV; + constexpr bool PvNode = NT == PV; const bool rootNode = PvNode && ss->ply == 0; assert(-VALUE_INFINITE <= alpha && alpha < beta && beta <= VALUE_INFINITE); @@ -1156,7 +1156,7 @@ moves_loop: // When in check, search starts from here template Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) { - const bool PvNode = NT == PV; + constexpr bool PvNode = NT == PV; const bool inCheck = bool(pos.checkers()); assert(alpha >= -VALUE_INFINITE && alpha < beta && beta <= VALUE_INFINITE);