From 955c927265c36396d6519a57b3d1e81a5c700420 Mon Sep 17 00:00:00 2001 From: Pieter te Brake Date: Mon, 8 Dec 2025 22:46:07 +0100 Subject: [PATCH] Removed redundant board updates Contrary to what the comment says, `remove_piece` does in fact set the relevant `board` elements to `NO_PIECE`. closes https://github.com/official-stockfish/Stockfish/pull/6471 No functional change --- src/position.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index cd778011f..a4286b86a 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1225,8 +1225,6 @@ void Position::do_castling(Color us, // Remove both pieces first since squares could overlap in Chess960 remove_piece(Do ? from : to, dts); remove_piece(Do ? rfrom : rto, dts); - board[Do ? from : to] = board[Do ? rfrom : rto] = - NO_PIECE; // remove_piece does not do this for us put_piece(make_piece(us, KING), Do ? to : from, dts); put_piece(make_piece(us, ROOK), Do ? rto : rfrom, dts); }