mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-26 12:06:22 +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:
@@ -89,7 +89,7 @@ Move move_from_uci(const Position& pos, string& str) {
|
||||
if (str.length() == 5) // Junior could send promotion piece in uppercase
|
||||
str[4] = char(tolower(str[4]));
|
||||
|
||||
for (MoveList<LEGAL> it(pos); !it.end(); ++it)
|
||||
for (MoveList<LEGAL> it(pos); *it; ++it)
|
||||
if (str == move_to_uci(*it, pos.is_chess960()))
|
||||
return *it;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user