mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-16 23:26:23 +08:00
Retire kingSquare[] array
It is redundant. Use pieceList[c][KING][0] instead. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -704,7 +704,7 @@ void Position::do_move(Move m, StateInfo& newSt, Bitboard dcCandidates) {
|
||||
struct ReducedStateInfo {
|
||||
Key key, pawnKey, materialKey;
|
||||
int castleRights, rule50;
|
||||
Square kingSquare[2], epSquare;
|
||||
Square epSquare;
|
||||
Value mgValue, egValue;
|
||||
Value npMaterial[2];
|
||||
};
|
||||
@@ -784,10 +784,6 @@ void Position::do_move(Move m, StateInfo& newSt, Bitboard dcCandidates) {
|
||||
board[to] = board[from];
|
||||
board[from] = EMPTY;
|
||||
|
||||
// If the moving piece was a king, update the king square
|
||||
if (pt == KING)
|
||||
st->kingSquare[us] = to;
|
||||
|
||||
// Update piece lists, note that index[from] is not updated and
|
||||
// becomes stale. This works as long as index[] is accessed just
|
||||
// by known occupied squares.
|
||||
@@ -1005,9 +1001,6 @@ void Position::do_castle_move(Move m) {
|
||||
board[kto] = king;
|
||||
board[rto] = rook;
|
||||
|
||||
// Update king square
|
||||
st->kingSquare[us] = kto;
|
||||
|
||||
// Update piece lists
|
||||
pieceList[us][KING][index[kfrom]] = kto;
|
||||
pieceList[us][ROOK][index[rfrom]] = rto;
|
||||
@@ -1519,9 +1512,6 @@ void Position::put_piece(Piece p, Square s) {
|
||||
set_bit(&byTypeBB[0], s); // HACK: byTypeBB[0] contains all occupied squares.
|
||||
|
||||
pieceCount[c][pt]++;
|
||||
|
||||
if (pt == KING)
|
||||
st->kingSquare[c] = s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user