mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 02:57:11 +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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user