In case several threads find the same bestmove,
report the longest PV line found.
closes https://github.com/official-stockfish/Stockfish/pull/4126
No functional change.
}
else if ( th->rootMoves[0].score >= VALUE_TB_WIN_IN_MAX_PLY
|| ( th->rootMoves[0].score > VALUE_TB_LOSS_IN_MAX_PLY
- && votes[th->rootMoves[0].pv[0]] > votes[bestThread->rootMoves[0].pv[0]]))
+ && ( votes[th->rootMoves[0].pv[0]] > votes[bestThread->rootMoves[0].pv[0]]
+ || ( votes[th->rootMoves[0].pv[0]] == votes[bestThread->rootMoves[0].pv[0]]
+ && th->rootMoves[0].pv.size() > bestThread->rootMoves[0].pv.size()))))
bestThread = th;
}