Assorted cleanups in benchmark.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-12-30 14:40:35 +01:00
parent 9d7a36121a
commit 93e539d909
2 changed files with 34 additions and 39 deletions
+4 -4
View 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;
}