mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 10:36:26 +08:00
Better condition in is_pseudo_legal()
Simplify occupied destination condition. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
committed by
Marco Costalba
parent
c45c6d308f
commit
1cc18d8a7a
@@ -542,7 +542,7 @@ bool Position::is_pseudo_legal(const Move m) const {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// The destination square cannot be occupied by a friendly piece
|
// The destination square cannot be occupied by a friendly piece
|
||||||
if (piece_on(to) != NO_PIECE && color_of(piece_on(to)) == us)
|
if (pieces(us) & to)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Handle the special case of a pawn move
|
// Handle the special case of a pawn move
|
||||||
|
|||||||
Reference in New Issue
Block a user