]> git.sesse.net Git - stockfish/commitdiff
Use sp->master instead of bestThread
authorMarco Costalba <mcostalba@gmail.com>
Sat, 21 Feb 2015 09:40:59 +0000 (10:40 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 21 Feb 2015 09:40:59 +0000 (10:40 +0100)
Verified with:

dbg_hit_on(th != sp->master);

It is 100% equivalent on more than 200K hits.

No functional change.

src/search.cpp

index 67693a38986dc1f93cdd285bc6244c8ec00f0e27..18c520f15fd71aebec2becbe72463612b5d84df0 100644 (file)
@@ -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;