X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=9be0fe600b7080375b0b28f75a23a282e2c6e9cf;hp=21022ae1b2c18dc7655eef0460d80cd3bdc054db;hb=fde0b9e701a6bfac05e56f6bffdc29943be56120;hpb=7a2825053e3eb5204e6b45d0cadb9264e77ac69f diff --git a/src/position.cpp b/src/position.cpp index 21022ae1..9be0fe60 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1271,12 +1271,11 @@ int Position::see(Move m) const { // Locate the least valuable attacker for the side to move. The loop // below looks like it is potentially infinite, but it isn't. We know // that the side to move still has at least one attacker left. - for (pt = PAWN; !(stmAttackers & pieces(pt)); pt++) + for (pt = PAWN; (b = stmAttackers & pieces(pt)) == 0; pt++) assert(pt < KING); // Remove the attacker we just found from the 'occupied' bitboard, // and scan for new X-ray attacks behind the attacker. - b = stmAttackers & pieces(pt); occ ^= (b & (~b + 1)); attackers |= (attacks_bb(to, occ) & pieces(ROOK, QUEEN)) | (attacks_bb(to, occ) & pieces(BISHOP, QUEEN));