X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=d654fec9c414a75be3fd6d406fdaf8fc24053613;hb=a530fc2b600da4e9247a0e0242dead246d824c68;hp=1786a6fdc60ebb235e708a7d7cfedaa63479987e;hpb=5e340346db94446587c78e791507ab9e2cffe3fa;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 1786a6fd..d654fec9 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -333,14 +333,14 @@ namespace { int perft(Position& pos, Depth depth) { Move move; - MovePicker mp = MovePicker(pos, MOVE_NONE, depth, H); int sum = 0; + MovePicker mp = MovePicker(pos, MOVE_NONE, depth, H); // If we are at the last ply we don't need to do and undo // the moves, just to count them. if (depth <= OnePly) // Replace with '<' to test also qsearch { - while ((move = mp.get_next_move()) != MOVE_NONE) sum++; + while (mp.get_next_move()) sum++; return sum; } @@ -348,10 +348,10 @@ int perft(Position& pos, Depth depth) CheckInfo ci(pos); while ((move = mp.get_next_move()) != MOVE_NONE) { - StateInfo st; - pos.do_move(move, st, ci, pos.move_is_check(move, ci)); - sum += perft(pos, depth - OnePly); - pos.undo_move(move); + StateInfo st; + pos.do_move(move, st, ci, pos.move_is_check(move, ci)); + sum += perft(pos, depth - OnePly); + pos.undo_move(move); } return sum; }