X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fbook.cpp;h=c5c40dde42f1546a4a8e6938ecc1a19c6190a983;hb=7b2cda95d9d697a047ac8df33d3805ba77590a8f;hp=b8bce9e1d07ba3e6630ee9e8746f5294187bc46a;hpb=c5ec94d0f1b128fc2c691c7231663a345409d5cc;p=stockfish diff --git a/src/book.cpp b/src/book.cpp index b8bce9e1..c5c40dde 100644 --- a/src/book.cpp +++ b/src/book.cpp @@ -361,7 +361,7 @@ PolyglotBook::~PolyglotBook() { if (is_open()) close(); } template PolyglotBook& PolyglotBook::operator>>(T& n) { n = 0; - for (size_t i = 0; i < sizeof(T); i++) + for (size_t i = 0; i < sizeof(T); ++i) n = T((n << 8) + ifstream::get()); return *this; @@ -436,9 +436,9 @@ Move PolyglotBook::probe(const Position& pos, const string& fName, bool pickBest move = make(from_sq(move), to_sq(move), PieceType(pt + 1)); // Add 'special move' flags and verify it is legal - for (MoveList ml(pos); !ml.end(); ++ml) - if (move == (ml.move() ^ type_of(ml.move()))) - return ml.move(); + for (MoveList it(pos); *it; ++it) + if (move == (*it ^ type_of(*it))) + return *it; return MOVE_NONE; }