mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
Microptimize MoveList loop
Add MOVE_NONE at the tail, this allows to loop across MoveList checking for *it != MOVE_NONE, and because *it is used imediately after compiler is able to reuse it. With this small patch perft speed increased of 3% And it is also a semplification ! No functional change.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user