Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaCat-OuO committed Nov 2, 2024
1 parent 835c491 commit 384ae4a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
7 changes: 1 addition & 6 deletions src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void Position::set_check_info() const {
// The function is only used when a new position is set up
void Position::set_state() const {

st->key = st->materialKey = 0;
st->key = 0;
st->majorPieceKey = st->minorPieceKey = 0;
st->nonPawnKey[WHITE] = st->nonPawnKey[BLACK] = 0;
st->pawnKey = Zobrist::noPawns;
Expand Down Expand Up @@ -257,10 +257,6 @@ void Position::set_state() const {

if (sideToMove == BLACK)
st->key ^= Zobrist::side;

for (Piece pc : Pieces)
for (int cnt = 0; cnt < pieceCount[pc]; ++cnt)
st->materialKey ^= Zobrist::psq[pc][cnt];
}


Expand Down Expand Up @@ -551,7 +547,6 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {

// Update hash key
k ^= Zobrist::psq[captured][capsq];
st->materialKey ^= Zobrist::psq[captured][pieceCount[captured]];

// Reset rule 60 counter
st->check10[WHITE] = st->check10[BLACK] = st->rule60 = 0;
Expand Down
4 changes: 0 additions & 4 deletions src/position.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class TranspositionTable;
struct StateInfo {

// Copied when making a move
Key materialKey;
Key pawnKey;
Key majorPieceKey;
Key minorPieceKey;
Expand Down Expand Up @@ -148,7 +147,6 @@ class Position {
// Accessing hash keys
Key key() const;
Key key_after(Move m) const;
Key material_key() const;
Key pawn_key() const;
Key major_piece_key() const;
Key minor_piece_key() const;
Expand Down Expand Up @@ -280,8 +278,6 @@ inline Key Position::adjust_key60(Key k) const {

inline Key Position::pawn_key() const { return st->pawnKey; }

inline Key Position::material_key() const { return st->materialKey; }

inline Key Position::major_piece_key() const { return st->majorPieceKey; }

inline Key Position::minor_piece_key() const { return st->minorPieceKey; }
Expand Down

0 comments on commit 384ae4a

Please sign in to comment.