diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index a86349b60b..efb3fef704 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -143,7 +143,7 @@ make(Args&&... args) template struct Traits> : public GenericTraits> { using PeekType = const T*; - static unsigned hash(const NonnullOwnPtr& p) { return (unsigned)p.ptr(); } + static unsigned hash(const NonnullOwnPtr& p) { return int_hash((u32)p.ptr()); } static void dump(const NonnullOwnPtr& p) { kprintf("%p", p.ptr()); } static bool equals(const NonnullOwnPtr& a, const NonnullOwnPtr& b) { return a.ptr() == b.ptr(); } }; diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index 675b58c0f7..745ac899f0 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -165,7 +165,7 @@ private: template struct Traits> : public GenericTraits> { using PeekType = const T*; - static unsigned hash(const OwnPtr& p) { return (unsigned)p.ptr(); } + static unsigned hash(const OwnPtr& p) { return int_hash((u32)p.ptr()); } static void dump(const OwnPtr& p) { kprintf("%p", p.ptr()); } static bool equals(const OwnPtr& a, const OwnPtr& b) { return a.ptr() == b.ptr(); } };