]> git.sesse.net Git - stockfish/commitdiff
Retire init_ss_array()
authorMarco Costalba <mcostalba@gmail.com>
Thu, 20 Jan 2011 08:05:52 +0000 (09:05 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 20 Jan 2011 18:34:25 +0000 (19:34 +0100)
No functional change.

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

index 2d390dd151c489f0af31ea18e1437b154f5a8ab5..b75f62791793fdb969ef9ffc173528bec1908e1e 100644 (file)
@@ -313,7 +313,6 @@ namespace {
   int nps(const Position& pos);
   void poll(const Position& pos);
   void wait_for_stop_or_ponderhit();
-  void init_ss_array(SearchStack* ss, int size);
 
 #if !defined(_MSC_VER)
   void* init_thread(void* threadID);
@@ -624,7 +623,7 @@ namespace {
     // Initialize FIXME move before Rml.init()
     TT.new_search();
     H.clear();
-    init_ss_array(ss, PLY_MAX_PLUS_2);
+    memset(ss, 0, PLY_MAX_PLUS_2 * sizeof(SearchStack));
     alpha = -VALUE_INFINITE, beta = VALUE_INFINITE;
     EasyMove = MOVE_NONE;
     aspirationDelta = 0;
@@ -1875,24 +1874,6 @@ split_point_start: // At split points actual search starts from here
   }
 
 
-  // init_ss_array() does a fast reset of the first entries of a SearchStack
-  // array and of all the excludedMove and skipNullMove entries.
-
-  void init_ss_array(SearchStack* ss, int size) {
-
-    for (int i = 0; i < size; i++, ss++)
-    {
-        ss->excludedMove = MOVE_NONE;
-        ss->skipNullMove = false;
-        ss->reduction = DEPTH_ZERO;
-        ss->sp = NULL;
-
-        if (i < 3)
-            ss->killers[0] = ss->killers[1] = ss->mateKiller = MOVE_NONE;
-    }
-  }
-
-
   // value_to_uci() converts a value to a string suitable for use with the UCI
   // protocol specifications:
   //
@@ -2595,7 +2576,7 @@ split_point_start: // At split points actual search starts from here
     Move* sm;
 
     // Initialize search stack
-    init_ss_array(ss, PLY_MAX_PLUS_2);
+    memset(ss, 0, PLY_MAX_PLUS_2 * sizeof(SearchStack));
     ss[0].eval = ss[0].evalMargin = VALUE_NONE;
     bestMoveChanges = 0;
     clear();