Sync sp_search() with search()
authorMarco Costalba <mcostalba@gmail.com>
Tue, 12 Oct 2010 08:14:40 +0000 (10:14 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 12 Oct 2010 11:19:47 +0000 (12:19 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 63a8221a5c57b2408d7d1e5a5552d2e689a14880..6ec744c859596415703fa8bef8e520f7eba47879 100644 (file)
@@ -1692,13 +1692,12 @@ namespace {
       if (value > sp->bestValue && !ThreadsMgr.thread_should_stop(threadID))
       {
           sp->bestValue = value;
-
-          if (sp->bestValue > sp->alpha)
+          if (value > sp->alpha)
           {
               if (!PvNode || value >= sp->beta)
                   sp->stopRequest = true;
 
-              if (PvNode && value < sp->beta) // This guarantees that always: sp->alpha < sp->beta
+              if (PvNode && value < sp->beta) // We want always sp->alpha < sp->beta
                   sp->alpha = value;
 
               sp->parentSstack->bestMove = ss->bestMove = move;