mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Implicit conversion from ExtMove to Move
Verified with perft there is no speed regression, and code is simpler. It is also conceptually correct becuase an extended move is just a move that happens to have also a score. No functional change.
This commit is contained in:
@@ -272,9 +272,9 @@ Move UCI::to_move(const Position& pos, string& str) {
|
||||
if (str.length() == 5) // Junior could send promotion piece in uppercase
|
||||
str[4] = char(tolower(str[4]));
|
||||
|
||||
for (const ExtMove& ms : MoveList<LEGAL>(pos))
|
||||
if (str == UCI::move(ms.move, pos.is_chess960()))
|
||||
return ms.move;
|
||||
for (const auto& m : MoveList<LEGAL>(pos))
|
||||
if (str == UCI::move(m, pos.is_chess960()))
|
||||
return m;
|
||||
|
||||
return MOVE_NONE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user