- // We calculate optimum time usage for different hypothetical "moves to go"-values and choose the
- // minimum of calculated search time values. Usually the greatest hypMTG gives the minimum values.
- for (hypMTG = 1; hypMTG <= (limits.movestogo ? std::min(limits.movestogo, MoveHorizon) : MoveHorizon); ++hypMTG)
+ startTime = limits.startTime;
+ optimumTime = maximumTime = std::max(limits.time[us], minThinkingTime);
+
+ const int MaxMTG = limits.movestogo ? std::min(limits.movestogo, MoveHorizon) : MoveHorizon;
+
+ // We calculate optimum time usage for different hypothetical "moves to go"-values
+ // and choose the minimum of calculated search time values. Usually the greatest
+ // hypMTG gives the minimum values.
+ for (int hypMTG = 1; hypMTG <= MaxMTG; ++hypMTG)