diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-29 19:14:03 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-29 19:14:03 +0200 |
commit | d5bb98acbcdbd39fcc8d028517189f44bc78e710 (patch) | |
tree | c8392686c2e277aac417df1627d4a09bff319838 /Kernel/FileSystem | |
parent | 9a7dc065676c5d60707c263f7c6b0f97fba38ad6 (diff) | |
download | serenity-d5bb98acbcdbd39fcc8d028517189f44bc78e710.zip |
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.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/DiskBackedFileSystem.cpp | 2 | ||||
-rw-r--r-- | Kernel/FileSystem/FileSystem.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/DiskBackedFileSystem.cpp b/Kernel/FileSystem/DiskBackedFileSystem.cpp index d8b66803a1..6a3f8ddc90 100644 --- a/Kernel/FileSystem/DiskBackedFileSystem.cpp +++ b/Kernel/FileSystem/DiskBackedFileSystem.cpp @@ -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); } }; diff --git a/Kernel/FileSystem/FileSystem.h b/Kernel/FileSystem/FileSystem.h index 58f839faef..55d48a4ff8 100644 --- a/Kernel/FileSystem/FileSystem.h +++ b/Kernel/FileSystem/FileSystem.h @@ -89,7 +89,7 @@ inline bool InodeIdentifier::is_root_inode() const namespace AK { template<> -struct Traits<InodeIdentifier> { +struct Traits<InodeIdentifier> : public GenericTraits<InodeIdentifier> { static unsigned hash(const InodeIdentifier& inode) { return pair_int_hash(inode.fsid(), inode.index()); } static void dump(const InodeIdentifier& inode) { kprintf("%02u:%08u", inode.fsid(), inode.index()); } }; |