Skip to content

Commit

Permalink
Avoid empty move list in last pv when using multiple threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthies committed Jul 7, 2021
1 parent 7139709 commit 42d9b4a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1356,15 +1356,19 @@ static void search_gen1(searchthread *thr)
}
}

// copy new pv to lastpv
int i = 0;
while (pos->pvtable[0][i])
int i;
if (pos->pvtable[0][0])
{
pos->lastpv[i] = pos->pvtable[0][i];
i++;
if (i == MAXDEPTH - 1) break;
// copy new pv to lastpv
i = 0;
while (pos->pvtable[0][i])
{
pos->lastpv[i] = pos->pvtable[0][i];
i++;
if (i == MAXDEPTH - 1) break;
}
pos->lastpv[i] = 0;
}
pos->lastpv[i] = 0;

nowtime = getTime();

Expand Down

0 comments on commit 42d9b4a

Please sign in to comment.