mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +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:
@@ -436,7 +436,7 @@ Move PolyglotBook::probe(const Position& pos, const string& fName, bool pickBest
|
||||
move = make<PROMOTION>(from_sq(move), to_sq(move), PieceType(pt + 1));
|
||||
|
||||
// Add 'special move' flags and verify it is legal
|
||||
for (MoveList<LEGAL> it(pos); !it.end(); ++it)
|
||||
for (MoveList<LEGAL> it(pos); *it; ++it)
|
||||
if (move == (*it ^ type_of(*it)))
|
||||
return *it;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user