Verified with:
dbg_hit_on(th != sp->master);
It is 100% equivalent on more than 200K hits.
No functional change.
// Try to late join to another split point if none of its slaves has
// already finished.
SplitPoint* bestSp = NULL;
- Thread* bestThread = NULL;
int bestScore = INT_MAX;
for (Thread* th : Threads)
if (score < bestScore)
{
bestSp = sp;
- bestThread = th;
bestScore = score;
}
}
if ( sp->allSlavesSearching
&& sp->slavesMask.count() < MAX_SLAVES_PER_SPLITPOINT
- && available_to(bestThread))
+ && available_to(sp->master))
{
sp->slavesMask.set(idx);
activeSplitPoint = sp;