From 1cc18d8a7af5af3a83b95034edab679942c54e4d Mon Sep 17 00:00:00 2001 From: Reuven Peleg Date: Mon, 22 Jul 2013 13:47:59 +0300 Subject: [PATCH] Better condition in is_pseudo_legal() Simplify occupied destination condition. No functional change. Signed-off-by: Marco Costalba --- src/position.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/position.cpp b/src/position.cpp index 55f8bcff..f7a89e07 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -542,7 +542,7 @@ bool Position::is_pseudo_legal(const Move m) const { return false; // 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; // Handle the special case of a pawn move -- 2.39.2