summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
Diffstat (limited to 'AK')
-rw-r--r--AK/HashMap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/AK/HashMap.h b/AK/HashMap.h
index f707c66068..4d4cdc516a 100644
--- a/AK/HashMap.h
+++ b/AK/HashMap.h
@@ -165,6 +165,16 @@ public:
return list;
}
+ [[nodiscard]] u32 hash() const
+ {
+ u32 hash = 0;
+ for (auto& it : *this) {
+ auto entry_hash = pair_int_hash(it.key.hash(), it.value.hash());
+ hash = pair_int_hash(hash, entry_hash);
+ }
+ return hash;
+ }
+
private:
HashTableType m_table;
};