diff --git a/Userland/Libraries/LibChess/Chess.h b/Userland/Libraries/LibChess/Chess.h index 5a75a8c5696..2a25972484c 100644 --- a/Userland/Libraries/LibChess/Chess.h +++ b/Userland/Libraries/LibChess/Chess.h @@ -278,7 +278,7 @@ void Board::generate_moves(Callback callback, Color color) const template<> struct AK::Traits : public GenericTraits { - static unsigned hash(const Chess::Piece& piece) + static unsigned hash(Chess::Piece const& piece) { return pair_int_hash(static_cast(piece.color), static_cast(piece.type)); } @@ -286,7 +286,7 @@ struct AK::Traits : public GenericTraits { template<> struct AK::Traits : public GenericTraits { - static unsigned hash(const Chess::Board chess) + static unsigned hash(Chess::Board const& chess) { unsigned hash = 0; hash = pair_int_hash(hash, static_cast(chess.m_white_can_castle_queenside)); @@ -294,8 +294,6 @@ struct AK::Traits : public GenericTraits { hash = pair_int_hash(hash, static_cast(chess.m_black_can_castle_queenside)); hash = pair_int_hash(hash, static_cast(chess.m_black_can_castle_kingside)); - hash = pair_int_hash(hash, static_cast(chess.m_black_can_castle_kingside)); - Chess::Square::for_each([&](Chess::Square sq) { hash = pair_int_hash(hash, Traits::hash(chess.get_piece(sq))); return IterationDecision::Continue;