From 64a71c3c02bdadfa80bed50fe5ba96984328627a Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 18 Feb 2014 08:30:13 +0100 Subject: [PATCH] Don't update pieceCount for ALL_PIECES It is currently unused and only adds overhead for nothing. Also set proper type of chess960. No functional change. --- src/position.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/position.h b/src/position.h index 03aa97d8..8d3393fa 100644 --- a/src/position.h +++ b/src/position.h @@ -206,7 +206,7 @@ private: Color sideToMove; Thread* thisThread; StateInfo* st; - int chess960; + bool chess960; }; inline uint64_t Position::nodes_searched() const { @@ -403,7 +403,6 @@ inline void Position::put_piece(Square s, Color c, PieceType pt) { byTypeBB[ALL_PIECES] |= s; byTypeBB[pt] |= s; byColorBB[c] |= s; - pieceCount[c][ALL_PIECES]++; index[s] = pieceCount[c][pt]++; pieceList[c][pt][index[s]] = s; } @@ -432,7 +431,6 @@ inline void Position::remove_piece(Square s, Color c, PieceType pt) { byTypeBB[pt] ^= s; byColorBB[c] ^= s; /* board[s] = NO_PIECE; */ // Not needed, will be overwritten by capturing - pieceCount[c][ALL_PIECES]--; Square lastSquare = pieceList[c][pt][--pieceCount[c][pt]]; index[lastSquare] = index[s]; pieceList[c][pt][index[lastSquare]] = lastSquare; -- 2.39.2