mirror of
https://github.com/anope/anope.git
synced 2026-06-26 14:56:39 +02:00
Implement serializer hashing in db_json.
This commit is contained in:
@@ -81,6 +81,18 @@ public:
|
||||
{
|
||||
return data[key];
|
||||
}
|
||||
|
||||
size_t Hash() const override
|
||||
{
|
||||
size_t hash = 0;
|
||||
for (const auto &[_, value] : this->data)
|
||||
{
|
||||
auto valuestr = value.str();
|
||||
if (!valuestr.empty())
|
||||
hash ^= Anope::hash_cs()(valuestr);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
|
||||
class DBJSON final
|
||||
|
||||
Reference in New Issue
Block a user