From 89a06f6651882248e185bb597135af3249ec8f6a Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 17 May 2011 23:44:55 +0100 Subject: [PATCH] Micro-optimize pl_move_is_legal() Remove the check for castling moves because it is already implicit in the check for king moves and castling is so rare that doing the check is just a slow down. Thanks to Marek Kwiatkowski. No functional change. Signed-off-by: Marco Costalba --- src/position.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index a9c98626..59caa88e 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -570,10 +570,6 @@ bool Position::pl_move_is_legal(Move m, Bitboard pinned) const { assert(move_is_ok(m)); assert(pinned == pinned_pieces(side_to_move())); - // Castling moves are checked for legality during move generation. - if (move_is_castle(m)) - return true; - // En passant captures are a tricky special case. Because they are // rather uncommon, we do it simply by testing whether the king is attacked // after the move is made -- 2.39.2