utils: uuid: define appending_hash<utils::tagged_uuid<Tag>>
And simplify usage for appending_hash<counter_shard_view> respectively. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
@@ -372,7 +372,7 @@ template<>
|
||||
struct appending_hash<counter_shard_view> {
|
||||
template<typename Hasher>
|
||||
void operator()(Hasher& h, const counter_shard_view& cshard) const {
|
||||
::feed_hash(h, cshard.id().uuid());
|
||||
::feed_hash(h, cshard.id());
|
||||
::feed_hash(h, cshard.value());
|
||||
::feed_hash(h, cshard.logical_clock());
|
||||
}
|
||||
|
||||
@@ -250,6 +250,14 @@ struct appending_hash<utils::UUID> {
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Tag>
|
||||
struct appending_hash<utils::tagged_uuid<Tag>> {
|
||||
template<typename Hasher>
|
||||
void operator()(Hasher& h, const utils::tagged_uuid<Tag>& id) const noexcept {
|
||||
appending_hash<utils::UUID>{}(h, id.uuid());
|
||||
}
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template<>
|
||||
struct hash<utils::UUID> {
|
||||
|
||||
Reference in New Issue
Block a user