mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
AK: Make StringView hashable
This commit is contained in:
parent
6e05685ad4
commit
67f2301150
Notes:
sideshowbarker
2024-07-19 01:57:24 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/67f23011509 Pull-request: https://github.com/SerenityOS/serenity/pull/3724 Issue: https://github.com/SerenityOS/serenity/issues/3714 Reviewed-by: https://github.com/linusg
1 changed files with 5 additions and 0 deletions
|
@ -187,6 +187,11 @@ private:
|
|||
size_t m_length { 0 };
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Traits<StringView> : public GenericTraits<String> {
|
||||
static unsigned hash(const StringView& s) { return s.hash(); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
using AK::StringView;
|
||||
|
|
Loading…
Reference in a new issue