Mimic an iterator for looping across MoveList

Seems more conventional.

No functional change.
This commit is contained in:
Marco Costalba
2013-05-19 13:28:25 +02:00
parent f7c013edd0
commit 8ceef92266
6 changed files with 15 additions and 15 deletions

View File

@@ -408,8 +408,8 @@ const string Position::pretty(Move move) const {
ss << square_to_string(pop_lsb(&b)) << " ";
ss << "\nLegal moves: ";
for (MoveList<LEGAL> ml(*this); !ml.end(); ++ml)
ss << move_to_san(*const_cast<Position*>(this), ml.move()) << " ";
for (MoveList<LEGAL> it(*this); !it.end(); ++it)
ss << move_to_san(*const_cast<Position*>(this), *it) << " ";
return ss.str();
}