- Square sq = pop_lsb(&attackers);
-
- // If the move is illegal, the piece is not included in the sub-set
- if (!pos.pl_move_is_legal(make_move(sq, to), pos.pinned_pieces()))
- continue;
-
- ambiguousFile |= file_of(sq) == file_of(from);
- ambiguousRank |= rank_of(sq) == rank_of(from);
- ambiguousMove = true;
+ Move move = make_move(pop_lsb(&b), to);
+ if (!pos.pl_move_is_legal(move, pos.pinned_pieces()))
+ others ^= from_sq(move);