mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Mimic an iterator for looping across MoveList
Seems more conventional. No functional change.
This commit is contained in:
@@ -163,11 +163,11 @@ size_t Search::perft(Position& pos, Depth depth) {
|
||||
size_t cnt = 0;
|
||||
CheckInfo ci(pos);
|
||||
|
||||
for (MoveList<LEGAL> ml(pos); !ml.end(); ++ml)
|
||||
for (MoveList<LEGAL> it(pos); !it.end(); ++it)
|
||||
{
|
||||
pos.do_move(ml.move(), st, ci, pos.move_gives_check(ml.move(), ci));
|
||||
pos.do_move(*it, st, ci, pos.move_gives_check(*it, ci));
|
||||
cnt += perft(pos, depth - ONE_PLY);
|
||||
pos.undo_move(ml.move());
|
||||
pos.undo_move(*it);
|
||||
}
|
||||
|
||||
return cnt;
|
||||
|
||||
Reference in New Issue
Block a user