]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Assorted cleanups in benchmark.cpp
[stockfish] / src / search.cpp
index baae494b9e6073f656a2ca715d7d91bf63cf843b..9222cbbd9fbb66a182211648b23012a44bad0eb0 100644 (file)
@@ -252,22 +252,22 @@ void Search::init() {
 int64_t Search::perft(Position& pos, Depth depth) {
 
   StateInfo st;
-  int64_t sum = 0;
+  int64_t cnt = 0;
 
   MoveList<MV_LEGAL> ml(pos);
 
   // At the last ply just return the number of moves (leaf nodes)
-  if (depth <= ONE_PLY)
+  if (depth == ONE_PLY)
       return ml.size();
 
   CheckInfo ci(pos);
   for ( ; !ml.end(); ++ml)
   {
       pos.do_move(ml.move(), st, ci, pos.move_gives_check(ml.move(), ci));
-      sum += perft(pos, depth - ONE_PLY);
+      cnt += perft(pos, depth - ONE_PLY);
       pos.undo_move(ml.move());
   }
-  return sum;
+  return cnt;
 }