]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Remove one hack caused by misunderstanding
[stockfish] / src / search.cpp
index 4a2acb62c810684c5eabedb471473b98e86e49e2..36ed82f2771a9c595c70c8835b2f7e9611fada31 100644 (file)
@@ -804,8 +804,8 @@ namespace {
     beta = *betaPtr;
     isCheck = pos.is_check();
 
-    // Step 1. Initialize node and poll (omitted at root, but I can see no good reason for this, FIXME)
-    // Step 2. Check for aborted search (omitted at root, because we do not initialize root node)
+    // Step 1. Initialize node and poll (omitted at root, init_ss_array() has already initialized root node)
+    // Step 2. Check for aborted search (omitted at root)
     // Step 3. Mate distance pruning (omitted at root)
     // Step 4. Transposition table lookup (omitted at root)
 
@@ -813,8 +813,6 @@ namespace {
     // At root we do this only to get reference value for child nodes
     if (!isCheck)
         ss[0].eval = evaluate(pos, ei, 0);
-    else
-        ss[0].eval = VALUE_NONE; // HACK because we do not initialize root node
 
     // Step 6. Razoring (omitted at root)
     // Step 7. Static null move pruning (omitted at root)
@@ -2409,7 +2407,7 @@ namespace {
         // If this thread is the master of a split point and all slaves have
         // finished their work at this split point, return from the idle loop.
         int i = 0;
-        for ( ; sp && !sp->slaves[i] && i < ActiveThreads; i++) {}
+        for ( ; sp && i < ActiveThreads && !sp->slaves[i]; i++) {}
 
         if (i == ActiveThreads)
         {