Microptimize MoveList loop
[stockfish] / src / thread.cpp
index 71b9ce0c091412e6424791c1e38bd4553fc04f7c..782cf1acc0dd5153fb8ba3bebad8cf69bc35da12 100644 (file)
@@ -371,7 +371,7 @@ void ThreadPool::start_thinking(const Position& pos, const LimitsType& limits,
   SetupStates = states; // Ownership transfer here
   RootMoves.clear();
 
-  for (MoveList<LEGAL> it(pos); !it.end(); ++it)
+  for (MoveList<LEGAL> it(pos); *it; ++it)
       if (   searchMoves.empty()
           || std::count(searchMoves.begin(), searchMoves.end(), *it))
           RootMoves.push_back(RootMove(*it));