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:
Marco Costalba
2015-01-31 18:39:51 +01:00
parent 81d6c4a0d6
commit 65f46794af
5 changed files with 15 additions and 13 deletions

View File

@@ -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;
}