From e74c2df907d5336d3d2b8ee7748b82270ebbf337 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 21 Feb 2015 10:40:59 +0100 Subject: [PATCH 1/1] Use sp->master instead of bestThread Verified with: dbg_hit_on(th != sp->master); It is 100% equivalent on more than 200K hits. No functional change. --- src/search.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 67693a38..18c520f1 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1583,7 +1583,6 @@ void Thread::idle_loop() { // 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) @@ -1611,7 +1610,6 @@ void Thread::idle_loop() { if (score < bestScore) { bestSp = sp; - bestThread = th; bestScore = score; } } @@ -1627,7 +1625,7 @@ void Thread::idle_loop() { if ( sp->allSlavesSearching && sp->slavesMask.count() < MAX_SLAVES_PER_SPLITPOINT - && available_to(bestThread)) + && available_to(sp->master)) { sp->slavesMask.set(idx); activeSplitPoint = sp; -- 2.39.2