mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 13:17:44 +00:00
Microptimize MoveList loop
Add MOVE_NONE at the tail, this allows to loop across MoveList checking for *it != MOVE_NONE, and because *it is used imediately after compiler is able to reuse it. With this small patch perft speed increased of 3% And it is also a semplification ! No functional change.
This commit is contained in:
+1
-1
@@ -163,7 +163,7 @@ size_t Search::perft(Position& pos, Depth depth) {
|
||||
size_t cnt = 0;
|
||||
CheckInfo ci(pos);
|
||||
|
||||
for (MoveList<LEGAL> it(pos); !it.end(); ++it)
|
||||
for (MoveList<LEGAL> it(pos); *it; ++it)
|
||||
{
|
||||
pos.do_move(*it, st, ci, pos.move_gives_check(*it, ci));
|
||||
cnt += perft(pos, depth - ONE_PLY);
|
||||
|
||||
Reference in New Issue
Block a user