mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09: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: 67f2301150
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 };
|
size_t m_length { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct Traits<StringView> : public GenericTraits<String> {
|
||||||
|
static unsigned hash(const StringView& s) { return s.hash(); }
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using AK::StringView;
|
using AK::StringView;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue