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);
// Prune moves with negative or equal SEE and also moves with positive
// SEE where capturing piece loses a tempo and SEE < beta - futilityBase.
if ( futilityBase < beta
- && depth < DEPTH_ZERO
&& pos.see(move, beta - futilityBase) <= 0)
{
bestValue = std::max(bestValue, futilityBase);