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

@@ -36,6 +36,8 @@ enum GenType {
struct ExtMove {
Move move;
Value value;
operator Move() const { return move; }
};
inline bool operator<(const ExtMove& f, const ExtMove& s) {
@@ -54,8 +56,8 @@ struct MoveList {
const ExtMove* begin() const { return moveList; }
const ExtMove* end() const { return last; }
size_t size() const { return last - moveList; }
bool contains(Move m) const {
for (const ExtMove& ms : *this) if (ms.move == m) return true;
bool contains(Move move) const {
for (const auto& m : *this) if (m == move) return true;
return false;
}