mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-30 19:46:48 +00:00
repair: Add hash specialization for partition_checksum
So we can store partition_checksum in std::map as key.
This commit is contained in:
@@ -108,3 +108,14 @@ public:
|
||||
future<partition_checksum> checksum_range(seastar::sharded<database> &db,
|
||||
const sstring& keyspace, const sstring& cf,
|
||||
const ::nonwrapping_range<dht::token>& range, repair_checksum rt);
|
||||
|
||||
namespace std {
|
||||
template<>
|
||||
struct hash<partition_checksum> {
|
||||
size_t operator()(partition_checksum sum) const {
|
||||
size_t h = 0;
|
||||
std::copy_n(sum.digest().begin(), std::min(sizeof(size_t), sizeof(sum.digest())), reinterpret_cast<uint8_t*>(&h));
|
||||
return h;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user