]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Micro-optimize pl_move_is_legal()
[stockfish] / src / position.cpp
index ec4fa14e8692fc5cddcd0dc026358625f7821d7d..59caa88e47e4b0bcc8220b4c9d8617b23f799946 100644 (file)
@@ -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
@@ -1519,11 +1515,6 @@ int Position::see(Move m) const {
   from = move_from(m);
   to = move_to(m);
   capturedType = type_of_piece_on(to);
-
-  // King cannot be recaptured
-  if (capturedType == KING)
-      return seeValues[capturedType];
-
   occupied = occupied_squares();
 
   // Handle en passant moves