mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
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 <mcostalba@gmail.com>
This commit is contained in:
parent
a2e924039b
commit
89a06f6651
1 changed files with 0 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue