mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-09 17:25:04 +00:00
AK: Defer to Traits<T> for equality comparison in container templates.
This is prep work for supporting HashMap with NonnullRefPtr<T> as values. It's currently not possible because many HashTable functions require being able to default-construct the value type.
This commit is contained in:
@@ -15,7 +15,7 @@ struct BlockIdentifier {
|
||||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<BlockIdentifier> {
|
||||
struct Traits<BlockIdentifier> : public GenericTraits<BlockIdentifier> {
|
||||
static unsigned hash(const BlockIdentifier& block_id) { return pair_int_hash(block_id.fsid, block_id.index); }
|
||||
static void dump(const BlockIdentifier& block_id) { kprintf("[block %02u:%08u]", block_id.fsid, block_id.index); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user