mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:27:35 +00:00
AK: Add ptr_hash to use int_hash or u64_hash depending on pointer size
This commit is contained in:
parent
32e6453b0b
commit
7e6ac544f7
3 changed files with 10 additions and 2 deletions
|
@ -204,7 +204,7 @@ inline void swap(OwnPtr<T>& a, OwnPtr<U>& b)
|
|||
template<typename T>
|
||||
struct Traits<OwnPtr<T>> : public GenericTraits<OwnPtr<T>> {
|
||||
using PeekType = const T*;
|
||||
static unsigned hash(const OwnPtr<T>& p) { return int_hash((u32)p.ptr()); }
|
||||
static unsigned hash(const OwnPtr<T>& p) { return ptr_hash(p.ptr()); }
|
||||
static bool equals(const OwnPtr<T>& a, const OwnPtr<T>& b) { return a.ptr() == b.ptr(); }
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue