Microptimize MoveList loop
[stockfish] / src / search.cpp
index a932cf32e37a7e54d4bb4fdd5fc8b9f61c1ceb26..8ba5b41af8be9cf182a02650dc9457d7fa515239 100644 (file)
@@ -163,7 +163,7 @@ size_t Search::perft(Position& pos, Depth depth) {
   size_t cnt = 0;
   CheckInfo ci(pos);
 
-  for (MoveList<LEGAL> it(pos); !it.end(); ++it)
+  for (MoveList<LEGAL> it(pos); *it; ++it)
   {
       pos.do_move(*it, st, ci, pos.move_gives_check(*it, ci));
       cnt += perft(pos, depth - ONE_PLY);