- // Stop search if most of the available time is already consumed. We
- // probably don't have enough time to search the first move at the
- // next iteration anyway.
- if (Time::now() - SearchTime > (TimeMgr.available_time() * 62) / 100)
- stop = true;
-
- // Stop search early if one move seems to be much better than others
- if ( depth >= 12
- && BestMoveChanges <= DBL_EPSILON
- && !stop
- && PVSize == 1
- && bestValue > VALUE_MATED_IN_MAX_PLY
- && ( RootMoves.size() == 1
- || Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
- {
- Value rBeta = bestValue - 2 * PawnValueMg;
- ss->excludedMove = RootMoves[0].pv[0];
- ss->skipNullMove = true;
- Value v = search<NonPV>(pos, ss, rBeta - 1, rBeta, (depth - 3) * ONE_PLY, true);
- ss->skipNullMove = false;
- ss->excludedMove = MOVE_NONE;
-
- if (v < rBeta)
- stop = true;
- }
-
- if (stop)
+ // Stop the search if only one legal move is available or all
+ // of the available time has been used.
+ if ( RootMoves.size() == 1
+ || Time::now() - SearchTime > TimeMgr.available_time())