mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 05:38:24 +00:00
AK: Use StringView as its own peek type
StringView is already a reference type, and copying it is cheap, so we should use it as its own peek type.
This commit is contained in:
parent
d7a721951e
commit
8468fb9ae5
Notes:
github-actions[bot]
2024-12-04 00:59:31 +00:00
Author: https://github.com/yyny
Commit: 8468fb9ae5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2567
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/gmta ✅
1 changed files with 2 additions and 0 deletions
|
@ -377,6 +377,8 @@ private:
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct Traits<StringView> : public DefaultTraits<StringView> {
|
struct Traits<StringView> : public DefaultTraits<StringView> {
|
||||||
|
using PeekType = StringView;
|
||||||
|
using ConstPeekType = StringView;
|
||||||
static unsigned hash(StringView s) { return s.hash(); }
|
static unsigned hash(StringView s) { return s.hash(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue