mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17: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
|
@ -278,7 +278,7 @@ inline const LogStream& operator<<(const LogStream& stream, const RefPtr<T>& val
|
|||
template<typename T>
|
||||
struct Traits<RefPtr<T>> : public GenericTraits<RefPtr<T>> {
|
||||
using PeekType = const T*;
|
||||
static unsigned hash(const RefPtr<T>& p) { return int_hash((u32)p.ptr()); }
|
||||
static unsigned hash(const RefPtr<T>& p) { return ptr_hash(p.ptr()); }
|
||||
static bool equals(const RefPtr<T>& a, const RefPtr<T>& b) { return a.ptr() == b.ptr(); }
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue