mirror of
https://github.com/sockspls/badfish
synced 2025-05-02 09:39:36 +00:00
Simplify "ponderhit" handling
If flag StopOnPonderhit is set it means that we UseTimeManagement and also we are at Iteration >= 3. So we can safely simplify the formula. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
191662a159
commit
7315001f37
1 changed files with 8 additions and 9 deletions
|
@ -1973,13 +1973,6 @@ split_point_start: // At split points actual search starts from here
|
||||||
static int lastInfoTime;
|
static int lastInfoTime;
|
||||||
int t = current_search_time();
|
int t = current_search_time();
|
||||||
|
|
||||||
bool stillAtFirstMove = FirstRootMove
|
|
||||||
&& !AspirationFailLow
|
|
||||||
&& t > TimeMgr.available_time();
|
|
||||||
|
|
||||||
bool noMoreTime = t > TimeMgr.maximum_time()
|
|
||||||
|| stillAtFirstMove;
|
|
||||||
|
|
||||||
// Poll for input
|
// Poll for input
|
||||||
if (data_available())
|
if (data_available())
|
||||||
{
|
{
|
||||||
|
@ -2010,8 +2003,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
// should continue searching but switching from pondering to normal search.
|
// should continue searching but switching from pondering to normal search.
|
||||||
Pondering = false;
|
Pondering = false;
|
||||||
|
|
||||||
if ( Iteration >= 3 && UseTimeManagement
|
if (StopOnPonderhit)
|
||||||
&& (noMoreTime || StopOnPonderhit))
|
|
||||||
StopRequest = true;
|
StopRequest = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2043,6 +2035,13 @@ split_point_start: // At split points actual search starts from here
|
||||||
if (Pondering)
|
if (Pondering)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool stillAtFirstMove = FirstRootMove
|
||||||
|
&& !AspirationFailLow
|
||||||
|
&& t > TimeMgr.available_time();
|
||||||
|
|
||||||
|
bool noMoreTime = t > TimeMgr.maximum_time()
|
||||||
|
|| stillAtFirstMove;
|
||||||
|
|
||||||
if ( (Iteration >= 3 && UseTimeManagement && noMoreTime)
|
if ( (Iteration >= 3 && UseTimeManagement && noMoreTime)
|
||||||
|| (ExactMaxTime && t >= ExactMaxTime)
|
|| (ExactMaxTime && t >= ExactMaxTime)
|
||||||
|| (Iteration >= 3 && MaxNodes && pos.nodes_searched() >= MaxNodes))
|
|| (Iteration >= 3 && MaxNodes && pos.nodes_searched() >= MaxNodes))
|
||||||
|
|
Loading…
Add table
Reference in a new issue