AK: Rename GenericTraits to DefaultTraits

This feels like a more fitting name for something that provides the
default values for Traits.
This commit is contained in:
Tim Schumacher 2023-11-08 20:29:12 +01:00 committed by Tim Flynn
parent ac23ab42b3
commit a2f60911fe
Notes: sideshowbarker 2024-07-17 21:11:12 +09:00
101 changed files with 154 additions and 154 deletions

View file

@ -341,7 +341,7 @@ private:
} }
template<> template<>
struct Traits<ByteBuffer> : public GenericTraits<ByteBuffer> { struct Traits<ByteBuffer> : public DefaultTraits<ByteBuffer> {
static unsigned hash(ByteBuffer const& byte_buffer) static unsigned hash(ByteBuffer const& byte_buffer)
{ {
return Traits<ReadonlyBytes>::hash(byte_buffer.span()); return Traits<ReadonlyBytes>::hash(byte_buffer.span());

View file

@ -95,7 +95,7 @@ private:
}; };
template<> template<>
struct Traits<DeprecatedFlyString> : public GenericTraits<DeprecatedFlyString> { struct Traits<DeprecatedFlyString> : public DefaultTraits<DeprecatedFlyString> {
static unsigned hash(DeprecatedFlyString const& s) { return s.hash(); } static unsigned hash(DeprecatedFlyString const& s) { return s.hash(); }
}; };

View file

@ -308,7 +308,7 @@ private:
}; };
template<> template<>
struct Traits<DeprecatedString> : public GenericTraits<DeprecatedString> { struct Traits<DeprecatedString> : public DefaultTraits<DeprecatedString> {
static unsigned hash(DeprecatedString const& s) { return s.impl() ? s.impl()->hash() : 0; } static unsigned hash(DeprecatedString const& s) { return s.impl() ? s.impl()->hash() : 0; }
}; };

View file

@ -449,7 +449,7 @@ private:
}; };
template<typename T> template<typename T>
struct Traits<DisjointSpans<T>> : public GenericTraits<DisjointSpans<T>> { struct Traits<DisjointSpans<T>> : public DefaultTraits<DisjointSpans<T>> {
static unsigned hash(DisjointSpans<T> const& span) static unsigned hash(DisjointSpans<T> const& span)
{ {
unsigned hash = 0; unsigned hash = 0;

View file

@ -326,7 +326,7 @@ struct Formatter<DistinctNumeric<T, X, Opts...>> : Formatter<T> {
constexpr bool operator==(DN n, E e) { return n.value() == to_underlying(e); } constexpr bool operator==(DN n, E e) { return n.value() == to_underlying(e); }
template<typename T, typename X, typename... Opts> template<typename T, typename X, typename... Opts>
struct Traits<AK::DistinctNumeric<T, X, Opts...>> : public GenericTraits<AK::DistinctNumeric<T, X, Opts...>> { struct Traits<AK::DistinctNumeric<T, X, Opts...>> : public DefaultTraits<AK::DistinctNumeric<T, X, Opts...>> {
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
static constexpr auto hash(DistinctNumeric<T, X, Opts...> const& d) { return Traits<T>::hash(d.value()); } static constexpr auto hash(DistinctNumeric<T, X, Opts...> const& d) { return Traits<T>::hash(d.value()); }
}; };

View file

@ -121,22 +121,22 @@ requires(HasFormatter<T>) struct Formatter<BigEndian<T>> : Formatter<T> {
}; };
template<typename T> template<typename T>
struct Traits<LittleEndian<T>> : public GenericTraits<LittleEndian<T>> { struct Traits<LittleEndian<T>> : public DefaultTraits<LittleEndian<T>> {
static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); } static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); }
}; };
template<typename T> template<typename T>
struct Traits<LittleEndian<T> const> : public GenericTraits<LittleEndian<T> const> { struct Traits<LittleEndian<T> const> : public DefaultTraits<LittleEndian<T> const> {
static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); } static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); }
}; };
template<typename T> template<typename T>
struct Traits<BigEndian<T>> : public GenericTraits<BigEndian<T>> { struct Traits<BigEndian<T>> : public DefaultTraits<BigEndian<T>> {
static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); } static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); }
}; };
template<typename T> template<typename T>
struct Traits<BigEndian<T> const> : public GenericTraits<BigEndian<T> const> { struct Traits<BigEndian<T> const> : public DefaultTraits<BigEndian<T> const> {
static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); } static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); }
}; };

View file

@ -86,7 +86,7 @@ private:
}; };
template<> template<>
struct Traits<FlyString> : public GenericTraits<FlyString> { struct Traits<FlyString> : public DefaultTraits<FlyString> {
static unsigned hash(FlyString const&); static unsigned hash(FlyString const&);
}; };

View file

@ -162,7 +162,7 @@ private:
static_assert(sizeof(IPv4Address) == 4); static_assert(sizeof(IPv4Address) == 4);
template<> template<>
struct Traits<IPv4Address> : public GenericTraits<IPv4Address> { struct Traits<IPv4Address> : public DefaultTraits<IPv4Address> {
static unsigned hash(IPv4Address const& address) { return secure_sip_hash(static_cast<u64>(address.to_u32())); } static unsigned hash(IPv4Address const& address) { return secure_sip_hash(static_cast<u64>(address.to_u32())); }
}; };

View file

@ -269,7 +269,7 @@ private:
static_assert(sizeof(IPv6Address) == 16); static_assert(sizeof(IPv6Address) == 16);
template<> template<>
struct Traits<IPv6Address> : public GenericTraits<IPv6Address> { struct Traits<IPv6Address> : public DefaultTraits<IPv6Address> {
// SipHash-4-8 is considered conservatively secure, even if not cryptographically secure. // SipHash-4-8 is considered conservatively secure, even if not cryptographically secure.
static unsigned hash(IPv6Address const& address) { return sip_hash_bytes<4, 8>({ &address.to_in6_addr_t(), sizeof(address.to_in6_addr_t()) }); } static unsigned hash(IPv6Address const& address) { return sip_hash_bytes<4, 8>({ &address.to_in6_addr_t(), sizeof(address.to_in6_addr_t()) }); }
}; };

View file

@ -111,7 +111,7 @@ static_assert(sizeof(MACAddress) == 6u);
namespace AK { namespace AK {
template<> template<>
struct Traits<MACAddress> : public GenericTraits<MACAddress> { struct Traits<MACAddress> : public DefaultTraits<MACAddress> {
static unsigned hash(MACAddress const& address) { return string_hash((char const*)&address, sizeof(address)); } static unsigned hash(MACAddress const& address) { return string_hash((char const*)&address, sizeof(address)); }
}; };

View file

@ -183,7 +183,7 @@ inline ErrorOr<NonnullOwnPtr<T>> try_make(Args&&... args)
} }
template<typename T> template<typename T>
struct Traits<NonnullOwnPtr<T>> : public GenericTraits<NonnullOwnPtr<T>> { struct Traits<NonnullOwnPtr<T>> : public DefaultTraits<NonnullOwnPtr<T>> {
using PeekType = T*; using PeekType = T*;
using ConstPeekType = T const*; using ConstPeekType = T const*;
static unsigned hash(NonnullOwnPtr<T> const& p) { return ptr_hash(p.ptr()); } static unsigned hash(NonnullOwnPtr<T> const& p) { return ptr_hash(p.ptr()); }

View file

@ -285,7 +285,7 @@ inline NonnullRefPtr<T> make_ref_counted(Args&&... args)
} }
template<typename T> template<typename T>
struct Traits<NonnullRefPtr<T>> : public GenericTraits<NonnullRefPtr<T>> { struct Traits<NonnullRefPtr<T>> : public DefaultTraits<NonnullRefPtr<T>> {
using PeekType = T*; using PeekType = T*;
using ConstPeekType = T const*; using ConstPeekType = T const*;
static unsigned hash(NonnullRefPtr<T> const& p) { return ptr_hash(p.ptr()); } static unsigned hash(NonnullRefPtr<T> const& p) { return ptr_hash(p.ptr()); }

View file

@ -193,7 +193,7 @@ inline OwnPtr<T> adopt_own_if_nonnull(T* object)
} }
template<typename T> template<typename T>
struct Traits<OwnPtr<T>> : public GenericTraits<OwnPtr<T>> { struct Traits<OwnPtr<T>> : public DefaultTraits<OwnPtr<T>> {
using PeekType = T*; using PeekType = T*;
using ConstPeekType = T const*; using ConstPeekType = T const*;
static unsigned hash(OwnPtr<T> const& p) { return ptr_hash(p.ptr()); } static unsigned hash(OwnPtr<T> const& p) { return ptr_hash(p.ptr()); }

View file

@ -293,7 +293,7 @@ struct Formatter<RefPtr<T>> : Formatter<T const*> {
}; };
template<typename T> template<typename T>
struct Traits<RefPtr<T>> : public GenericTraits<RefPtr<T>> { struct Traits<RefPtr<T>> : public DefaultTraits<RefPtr<T>> {
using PeekType = T*; using PeekType = T*;
using ConstPeekType = T const*; using ConstPeekType = T const*;
static unsigned hash(RefPtr<T> const& p) { return ptr_hash(p.ptr()); } static unsigned hash(RefPtr<T> const& p) { return ptr_hash(p.ptr()); }

View file

@ -296,7 +296,7 @@ public:
}; };
template<typename T> template<typename T>
struct Traits<Span<T>> : public GenericTraits<Span<T>> { struct Traits<Span<T>> : public DefaultTraits<Span<T>> {
static unsigned hash(Span<T> const& span) static unsigned hash(Span<T> const& span)
{ {
unsigned hash = 0; unsigned hash = 0;

View file

@ -257,7 +257,7 @@ private:
}; };
template<> template<>
struct Traits<String> : public GenericTraits<String> { struct Traits<String> : public DefaultTraits<String> {
static unsigned hash(String const&); static unsigned hash(String const&);
}; };

View file

@ -360,7 +360,7 @@ private:
}; };
template<> template<>
struct Traits<StringView> : public GenericTraits<StringView> { struct Traits<StringView> : public DefaultTraits<StringView> {
static unsigned hash(StringView s) { return s.hash(); } static unsigned hash(StringView s) { return s.hash(); }
}; };

View file

@ -16,7 +16,7 @@
namespace AK { namespace AK {
template<typename T> template<typename T>
struct GenericTraits { struct DefaultTraits {
using PeekType = T&; using PeekType = T&;
using ConstPeekType = T const&; using ConstPeekType = T const&;
static constexpr bool is_trivial() { return false; } static constexpr bool is_trivial() { return false; }
@ -27,11 +27,11 @@ struct GenericTraits {
}; };
template<typename T> template<typename T>
struct Traits : public GenericTraits<T> { struct Traits : public DefaultTraits<T> {
}; };
template<Integral T> template<Integral T>
struct Traits<T> : public GenericTraits<T> { struct Traits<T> : public DefaultTraits<T> {
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
static unsigned hash(T value) static unsigned hash(T value)
@ -42,7 +42,7 @@ struct Traits<T> : public GenericTraits<T> {
#ifndef KERNEL #ifndef KERNEL
template<FloatingPoint T> template<FloatingPoint T>
struct Traits<T> : public GenericTraits<T> { struct Traits<T> : public DefaultTraits<T> {
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
static unsigned hash(T value) static unsigned hash(T value)
@ -53,20 +53,20 @@ struct Traits<T> : public GenericTraits<T> {
#endif #endif
template<typename T> template<typename T>
requires(IsPointer<T> && !Detail::IsPointerOfType<char, T>) struct Traits<T> : public GenericTraits<T> { requires(IsPointer<T> && !Detail::IsPointerOfType<char, T>) struct Traits<T> : public DefaultTraits<T> {
static unsigned hash(T p) { return standard_sip_hash(bit_cast<FlatPtr>(p)); } static unsigned hash(T p) { return standard_sip_hash(bit_cast<FlatPtr>(p)); }
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
}; };
template<Enum T> template<Enum T>
struct Traits<T> : public GenericTraits<T> { struct Traits<T> : public DefaultTraits<T> {
static unsigned hash(T value) { return Traits<UnderlyingType<T>>::hash(to_underlying(value)); } static unsigned hash(T value) { return Traits<UnderlyingType<T>>::hash(to_underlying(value)); }
static constexpr bool is_trivial() { return Traits<UnderlyingType<T>>::is_trivial(); } static constexpr bool is_trivial() { return Traits<UnderlyingType<T>>::is_trivial(); }
static constexpr bool is_trivially_serializable() { return Traits<UnderlyingType<T>>::is_trivially_serializable(); } static constexpr bool is_trivially_serializable() { return Traits<UnderlyingType<T>>::is_trivially_serializable(); }
}; };
template<typename T> template<typename T>
requires(Detail::IsPointerOfType<char, T>) struct Traits<T> : public GenericTraits<T> { requires(Detail::IsPointerOfType<char, T>) struct Traits<T> : public DefaultTraits<T> {
static unsigned hash(T const value) { return string_hash(value, strlen(value)); } static unsigned hash(T const value) { return string_hash(value, strlen(value)); }
static constexpr bool equals(T const a, T const b) { return strcmp(a, b); } static constexpr bool equals(T const a, T const b) { return strcmp(a, b); }
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
@ -75,6 +75,6 @@ requires(Detail::IsPointerOfType<char, T>) struct Traits<T> : public GenericTrai
} }
#if USING_AK_GLOBALLY #if USING_AK_GLOBALLY
using AK::GenericTraits; using AK::DefaultTraits;
using AK::Traits; using AK::Traits;
#endif #endif

View file

@ -581,7 +581,7 @@ private:
}; };
template<size_t M> template<size_t M>
struct Traits<UFixedBigInt<M>> : public GenericTraits<UFixedBigInt<M>> { struct Traits<UFixedBigInt<M>> : public DefaultTraits<UFixedBigInt<M>> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
}; };

View file

@ -197,7 +197,7 @@ struct Formatter<URL> : Formatter<StringView> {
}; };
template<> template<>
struct Traits<URL> : public GenericTraits<URL> { struct Traits<URL> : public DefaultTraits<URL> {
static unsigned hash(URL const& url) { return url.to_deprecated_string().hash(); } static unsigned hash(URL const& url) { return url.to_deprecated_string().hash(); }
}; };

View file

@ -88,7 +88,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Kernel::InodeIdentifier> : public GenericTraits<Kernel::InodeIdentifier> { struct Traits<Kernel::InodeIdentifier> : public DefaultTraits<Kernel::InodeIdentifier> {
static unsigned hash(Kernel::InodeIdentifier const& inode) { return pair_int_hash(inode.fsid().value(), inode.index().value()); } static unsigned hash(Kernel::InodeIdentifier const& inode) { return pair_int_hash(inode.fsid().value(), inode.index().value()); }
}; };

View file

@ -86,7 +86,7 @@ struct Formatter<NonnullOwnPtr<Kernel::KString>> : Formatter<StringView> {
}; };
template<> template<>
struct Traits<NonnullOwnPtr<Kernel::KString>> : public GenericTraits<NonnullOwnPtr<Kernel::KString>> { struct Traits<NonnullOwnPtr<Kernel::KString>> : public DefaultTraits<NonnullOwnPtr<Kernel::KString>> {
using PeekType = Kernel::KString*; using PeekType = Kernel::KString*;
using ConstPeekType = Kernel::KString const*; using ConstPeekType = Kernel::KString const*;
static unsigned hash(NonnullOwnPtr<Kernel::KString> const& p) { return string_hash(p->characters(), p->length()); } static unsigned hash(NonnullOwnPtr<Kernel::KString> const& p) { return string_hash(p->characters(), p->length()); }
@ -95,7 +95,7 @@ struct Traits<NonnullOwnPtr<Kernel::KString>> : public GenericTraits<NonnullOwnP
}; };
template<> template<>
struct Traits<OwnPtr<Kernel::KString>> : public GenericTraits<OwnPtr<Kernel::KString>> { struct Traits<OwnPtr<Kernel::KString>> : public DefaultTraits<OwnPtr<Kernel::KString>> {
using PeekType = Kernel::KString*; using PeekType = Kernel::KString*;
using ConstPeekType = Kernel::KString const*; using ConstPeekType = Kernel::KString const*;
static unsigned hash(OwnPtr<Kernel::KString> const& p) static unsigned hash(OwnPtr<Kernel::KString> const& p)

View file

@ -460,7 +460,7 @@ struct Formatter<LockRefPtr<T>> : Formatter<T const*> {
}; };
template<typename T> template<typename T>
struct Traits<LockRefPtr<T>> : public GenericTraits<LockRefPtr<T>> { struct Traits<LockRefPtr<T>> : public DefaultTraits<LockRefPtr<T>> {
using PeekType = T*; using PeekType = T*;
using ConstPeekType = T const*; using ConstPeekType = T const*;
static unsigned hash(LockRefPtr<T> const& p) { return ptr_hash(p.ptr()); } static unsigned hash(LockRefPtr<T> const& p) { return ptr_hash(p.ptr()); }

View file

@ -329,7 +329,7 @@ requires(IsConvertible<U*, T*>)
} }
template<typename T> template<typename T>
struct Traits<NonnullLockRefPtr<T>> : public GenericTraits<NonnullLockRefPtr<T>> { struct Traits<NonnullLockRefPtr<T>> : public DefaultTraits<NonnullLockRefPtr<T>> {
using PeekType = T*; using PeekType = T*;
using ConstPeekType = T const*; using ConstPeekType = T const*;
static unsigned hash(NonnullLockRefPtr<T> const& p) { return ptr_hash(p.ptr()); } static unsigned hash(NonnullLockRefPtr<T> const& p) { return ptr_hash(p.ptr()); }

View file

@ -56,7 +56,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Kernel::IPv4SocketTuple> : public GenericTraits<Kernel::IPv4SocketTuple> { struct Traits<Kernel::IPv4SocketTuple> : public DefaultTraits<Kernel::IPv4SocketTuple> {
static unsigned hash(Kernel::IPv4SocketTuple const& tuple) static unsigned hash(Kernel::IPv4SocketTuple const& tuple)
{ {
auto h1 = pair_int_hash(tuple.local_address().to_u32(), tuple.local_port()); auto h1 = pair_int_hash(tuple.local_address().to_u32(), tuple.local_port());

View file

@ -1098,7 +1098,7 @@ struct AK::Formatter<Kernel::Process> : AK::Formatter<FormatString> {
namespace AK { namespace AK {
template<> template<>
struct Traits<Kernel::GlobalFutexKey> : public GenericTraits<Kernel::GlobalFutexKey> { struct Traits<Kernel::GlobalFutexKey> : public DefaultTraits<Kernel::GlobalFutexKey> {
static unsigned hash(Kernel::GlobalFutexKey const& futex_key) { return pair_int_hash(ptr_hash(futex_key.raw.parent), ptr_hash(futex_key.raw.offset)); } static unsigned hash(Kernel::GlobalFutexKey const& futex_key) { return pair_int_hash(ptr_hash(futex_key.raw.parent), ptr_hash(futex_key.raw.offset)); }
static bool equals(Kernel::GlobalFutexKey const& a, Kernel::GlobalFutexKey const& b) { return a.raw.parent == b.raw.parent && a.raw.offset == b.raw.offset; } static bool equals(Kernel::GlobalFutexKey const& a, Kernel::GlobalFutexKey const& b) { return a.raw.parent == b.raw.parent && a.raw.offset == b.raw.offset; }
}; };

View file

@ -28,7 +28,7 @@ static NSString* const CSS_PROPERTY_COLUMN = @"Property";
static NSString* const CSS_VALUE_COLUMN = @"Value"; static NSString* const CSS_VALUE_COLUMN = @"Value";
template<> template<>
struct AK::Traits<NSDictionary*> : public GenericTraits<NSDictionary*> { struct AK::Traits<NSDictionary*> : public DefaultTraits<NSDictionary*> {
static unsigned hash(NSDictionary* dictionary) static unsigned hash(NSDictionary* dictionary)
{ {
return [dictionary hash]; return [dictionary hash];

View file

@ -118,7 +118,7 @@ struct AK::Formatter<CalendarPattern> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<CalendarPattern> : public GenericTraits<CalendarPattern> { struct AK::Traits<CalendarPattern> : public DefaultTraits<CalendarPattern> {
static unsigned hash(CalendarPattern const& c) { return c.hash(); } static unsigned hash(CalendarPattern const& c) { return c.hash(); }
}; };
@ -185,7 +185,7 @@ struct AK::Formatter<CalendarRangePattern> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<CalendarRangePattern> : public GenericTraits<CalendarRangePattern> { struct AK::Traits<CalendarRangePattern> : public DefaultTraits<CalendarRangePattern> {
static unsigned hash(CalendarRangePattern const& c) { return c.hash(); } static unsigned hash(CalendarRangePattern const& c) { return c.hash(); }
}; };
@ -226,7 +226,7 @@ struct AK::Formatter<CalendarFormat> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<CalendarFormat> : public GenericTraits<CalendarFormat> { struct AK::Traits<CalendarFormat> : public DefaultTraits<CalendarFormat> {
static unsigned hash(CalendarFormat const& c) { return c.hash(); } static unsigned hash(CalendarFormat const& c) { return c.hash(); }
}; };
@ -265,7 +265,7 @@ struct AK::Formatter<CalendarSymbols> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<CalendarSymbols> : public GenericTraits<CalendarSymbols> { struct AK::Traits<CalendarSymbols> : public DefaultTraits<CalendarSymbols> {
static unsigned hash(CalendarSymbols const& c) { return c.hash(); } static unsigned hash(CalendarSymbols const& c) { return c.hash(); }
}; };
@ -329,7 +329,7 @@ struct AK::Formatter<Calendar> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<Calendar> : public GenericTraits<Calendar> { struct AK::Traits<Calendar> : public DefaultTraits<Calendar> {
static unsigned hash(Calendar const& c) { return c.hash(); } static unsigned hash(Calendar const& c) { return c.hash(); }
}; };
@ -381,7 +381,7 @@ struct AK::Formatter<TimeZoneNames> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<TimeZoneNames> : public GenericTraits<TimeZoneNames> { struct AK::Traits<TimeZoneNames> : public DefaultTraits<TimeZoneNames> {
static unsigned hash(TimeZoneNames const& t) { return t.hash(); } static unsigned hash(TimeZoneNames const& t) { return t.hash(); }
}; };
@ -432,7 +432,7 @@ struct AK::Formatter<TimeZoneFormat> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<TimeZoneFormat> : public GenericTraits<TimeZoneFormat> { struct AK::Traits<TimeZoneFormat> : public DefaultTraits<TimeZoneFormat> {
static unsigned hash(TimeZoneFormat const& t) { return t.hash(); } static unsigned hash(TimeZoneFormat const& t) { return t.hash(); }
}; };
@ -470,7 +470,7 @@ struct AK::Formatter<DayPeriod> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<DayPeriod> : public GenericTraits<DayPeriod> { struct AK::Traits<DayPeriod> : public DefaultTraits<DayPeriod> {
static unsigned hash(DayPeriod const& d) { return d.hash(); } static unsigned hash(DayPeriod const& d) { return d.hash(); }
}; };

View file

@ -61,7 +61,7 @@ struct AK::Formatter<DisplayPattern> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<DisplayPattern> : public GenericTraits<DisplayPattern> { struct AK::Traits<DisplayPattern> : public DefaultTraits<DisplayPattern> {
static unsigned hash(DisplayPattern const& p) { return p.hash(); } static unsigned hash(DisplayPattern const& p) { return p.hash(); }
}; };
@ -110,7 +110,7 @@ struct AK::Formatter<ListPatterns> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<ListPatterns> : public GenericTraits<ListPatterns> { struct AK::Traits<ListPatterns> : public DefaultTraits<ListPatterns> {
static unsigned hash(ListPatterns const& p) { return p.hash(); } static unsigned hash(ListPatterns const& p) { return p.hash(); }
}; };
@ -139,7 +139,7 @@ struct AK::Formatter<TextLayout> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<TextLayout> : public GenericTraits<TextLayout> { struct AK::Traits<TextLayout> : public DefaultTraits<TextLayout> {
static unsigned hash(TextLayout const& t) { return t.hash(); } static unsigned hash(TextLayout const& t) { return t.hash(); }
}; };

View file

@ -90,7 +90,7 @@ struct AK::Formatter<NumberFormat> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<NumberFormat> : public GenericTraits<NumberFormat> { struct AK::Traits<NumberFormat> : public DefaultTraits<NumberFormat> {
static unsigned hash(NumberFormat const& f) { return f.hash(); } static unsigned hash(NumberFormat const& f) { return f.hash(); }
}; };
@ -167,7 +167,7 @@ struct AK::Formatter<NumberSystem> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<NumberSystem> : public GenericTraits<NumberSystem> { struct AK::Traits<NumberSystem> : public DefaultTraits<NumberSystem> {
static unsigned hash(NumberSystem const& s) { return s.hash(); } static unsigned hash(NumberSystem const& s) { return s.hash(); }
}; };
@ -209,7 +209,7 @@ struct AK::Formatter<Unit> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<Unit> : public GenericTraits<Unit> { struct AK::Traits<Unit> : public DefaultTraits<Unit> {
static unsigned hash(Unit const& u) { return u.hash(); } static unsigned hash(Unit const& u) { return u.hash(); }
}; };

View file

@ -61,7 +61,7 @@ struct AK::Formatter<RelativeTimeFormat> : Formatter<FormatString> {
}; };
template<> template<>
struct AK::Traits<RelativeTimeFormat> : public GenericTraits<RelativeTimeFormat> { struct AK::Traits<RelativeTimeFormat> : public DefaultTraits<RelativeTimeFormat> {
static unsigned hash(RelativeTimeFormat const& format) { return format.hash(); } static unsigned hash(RelativeTimeFormat const& format) { return format.hash(); }
}; };

View file

@ -33,7 +33,7 @@ template<typename T>
concept IntegralOrEnum = Integral<T> || Enum<T>; concept IntegralOrEnum = Integral<T> || Enum<T>;
template<IntegralOrEnum T> template<IntegralOrEnum T>
struct AK::Traits<Vector<T>> : public GenericTraits<Vector<T>> { struct AK::Traits<Vector<T>> : public DefaultTraits<Vector<T>> {
static unsigned hash(Vector<T> const& list) static unsigned hash(Vector<T> const& list)
{ {
auto hash = int_hash(static_cast<u32>(list.size())); auto hash = int_hash(static_cast<u32>(list.size()));

View file

@ -230,7 +230,7 @@ bool property_has_quirk(PropertyID, Quirk);
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::CSS::PropertyID> : public GenericTraits<Web::CSS::PropertyID> { struct Traits<Web::CSS::PropertyID> : public DefaultTraits<Web::CSS::PropertyID> {
static unsigned hash(Web::CSS::PropertyID property_id) { return int_hash((unsigned)property_id); } static unsigned hash(Web::CSS::PropertyID property_id) { return int_hash((unsigned)property_id); }
}; };
} // namespace AK } // namespace AK

View file

@ -155,7 +155,7 @@ TEST_CASE(many_strings)
TEST_CASE(many_collisions) TEST_CASE(many_collisions)
{ {
struct StringCollisionTraits : public GenericTraits<DeprecatedString> { struct StringCollisionTraits : public DefaultTraits<DeprecatedString> {
static unsigned hash(DeprecatedString const&) { return 0; } static unsigned hash(DeprecatedString const&) { return 0; }
}; };
@ -176,7 +176,7 @@ TEST_CASE(many_collisions)
TEST_CASE(space_reuse) TEST_CASE(space_reuse)
{ {
struct StringCollisionTraits : public GenericTraits<DeprecatedString> { struct StringCollisionTraits : public DefaultTraits<DeprecatedString> {
static unsigned hash(DeprecatedString const&) { return 0; } static unsigned hash(DeprecatedString const&) { return 0; }
}; };

View file

@ -200,6 +200,6 @@ private:
} }
template<> template<>
struct AK::Traits<Maps::MapWidget::TileKey> : public GenericTraits<Maps::MapWidget::TileKey> { struct AK::Traits<Maps::MapWidget::TileKey> : public DefaultTraits<Maps::MapWidget::TileKey> {
static unsigned hash(Maps::MapWidget::TileKey const& t) { return t.hash(); } static unsigned hash(Maps::MapWidget::TileKey const& t) { return t.hash(); }
}; };

View file

@ -179,7 +179,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Spreadsheet::Position> : public GenericTraits<Spreadsheet::Position> { struct Traits<Spreadsheet::Position> : public DefaultTraits<Spreadsheet::Position> {
static constexpr bool is_trivial() { return false; } static constexpr bool is_trivial() { return false; }
static unsigned hash(Spreadsheet::Position const& p) static unsigned hash(Spreadsheet::Position const& p)
{ {

View file

@ -69,7 +69,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<UserspaceEmulator::Range> : public GenericTraits<UserspaceEmulator::Range> { struct Traits<UserspaceEmulator::Range> : public DefaultTraits<UserspaceEmulator::Range> {
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
}; };
} }

View file

@ -37,7 +37,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Marble> : public GenericTraits<Marble> { struct Traits<Marble> : public DefaultTraits<Marble> {
static unsigned hash(Marble const& marble) static unsigned hash(Marble const& marble)
{ {
return Traits<Marble::Point>::hash(marble.position()); return Traits<Marble::Point>::hash(marble.position());

View file

@ -97,7 +97,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<AccelGfx::Painter::GlyphsTextureKey> : public GenericTraits<AccelGfx::Painter::GlyphsTextureKey> { struct Traits<AccelGfx::Painter::GlyphsTextureKey> : public DefaultTraits<AccelGfx::Painter::GlyphsTextureKey> {
static unsigned hash(AccelGfx::Painter::GlyphsTextureKey const& key) static unsigned hash(AccelGfx::Painter::GlyphsTextureKey const& key)
{ {
return pair_int_hash(ptr_hash(key.font), key.code_point); return pair_int_hash(ptr_hash(key.font), key.code_point);

View file

@ -157,6 +157,6 @@ private:
} }
template<> template<>
struct AK::Traits<Archive::TarFileHeader> : public AK::GenericTraits<Archive::TarFileHeader> { struct AK::Traits<Archive::TarFileHeader> : public AK::DefaultTraits<Archive::TarFileHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -293,7 +293,7 @@ void Board::generate_moves(Callback callback, Color color) const
} }
template<> template<>
struct AK::Traits<Chess::Piece> : public GenericTraits<Chess::Piece> { struct AK::Traits<Chess::Piece> : public DefaultTraits<Chess::Piece> {
static unsigned hash(Chess::Piece const& piece) static unsigned hash(Chess::Piece const& piece)
{ {
return pair_int_hash(static_cast<u32>(piece.color), static_cast<u32>(piece.type)); return pair_int_hash(static_cast<u32>(piece.color), static_cast<u32>(piece.type));
@ -301,7 +301,7 @@ struct AK::Traits<Chess::Piece> : public GenericTraits<Chess::Piece> {
}; };
template<> template<>
struct AK::Traits<Chess::Board> : public GenericTraits<Chess::Board> { struct AK::Traits<Chess::Board> : public DefaultTraits<Chess::Board> {
static unsigned hash(Chess::Board const& chess) static unsigned hash(Chess::Board const& chess)
{ {
unsigned hash = 0; unsigned hash = 0;

View file

@ -189,7 +189,7 @@ void CppComprehensionEngine::for_each_included_document_recursive(DocumentData c
namespace AK { namespace AK {
template<> template<>
struct Traits<CodeComprehension::Cpp::CppComprehensionEngine::SymbolName> : public GenericTraits<CodeComprehension::Cpp::CppComprehensionEngine::SymbolName> { struct Traits<CodeComprehension::Cpp::CppComprehensionEngine::SymbolName> : public DefaultTraits<CodeComprehension::Cpp::CppComprehensionEngine::SymbolName> {
static unsigned hash(CodeComprehension::Cpp::CppComprehensionEngine::SymbolName const& key) static unsigned hash(CodeComprehension::Cpp::CppComprehensionEngine::SymbolName const& key)
{ {
unsigned hash = 0; unsigned hash = 0;

View file

@ -271,6 +271,6 @@ private:
} }
template<> template<>
struct AK::Traits<Compress::LzmaHeader> : public AK::GenericTraits<Compress::LzmaHeader> { struct AK::Traits<Compress::LzmaHeader> : public AK::DefaultTraits<Compress::LzmaHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -162,16 +162,16 @@ private:
} }
template<> template<>
struct AK::Traits<Compress::XzStreamHeader> : public AK::GenericTraits<Compress::XzStreamHeader> { struct AK::Traits<Compress::XzStreamHeader> : public AK::DefaultTraits<Compress::XzStreamHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct AK::Traits<Compress::XzStreamFooter> : public AK::GenericTraits<Compress::XzStreamFooter> { struct AK::Traits<Compress::XzStreamFooter> : public AK::DefaultTraits<Compress::XzStreamFooter> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct AK::Traits<Compress::XzBlockFlags> : public AK::GenericTraits<Compress::XzBlockFlags> { struct AK::Traits<Compress::XzBlockFlags> : public AK::DefaultTraits<Compress::XzBlockFlags> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -88,6 +88,6 @@ private:
} }
template<> template<>
struct AK::Traits<Compress::ZlibHeader> : public AK::GenericTraits<Compress::ZlibHeader> { struct AK::Traits<Compress::ZlibHeader> : public AK::DefaultTraits<Compress::ZlibHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -40,7 +40,7 @@ struct [[gnu::packed]] Socks5VersionIdentifierAndMethodSelectionMessage {
}; };
template<> template<>
struct AK::Traits<Socks5VersionIdentifierAndMethodSelectionMessage> : public AK::GenericTraits<Socks5VersionIdentifierAndMethodSelectionMessage> { struct AK::Traits<Socks5VersionIdentifierAndMethodSelectionMessage> : public AK::DefaultTraits<Socks5VersionIdentifierAndMethodSelectionMessage> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
@ -50,7 +50,7 @@ struct [[gnu::packed]] Socks5InitialResponse {
}; };
template<> template<>
struct AK::Traits<Socks5InitialResponse> : public AK::GenericTraits<Socks5InitialResponse> { struct AK::Traits<Socks5InitialResponse> : public AK::DefaultTraits<Socks5InitialResponse> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
@ -61,7 +61,7 @@ struct [[gnu::packed]] Socks5ConnectRequestHeader {
}; };
template<> template<>
struct AK::Traits<Socks5ConnectRequestHeader> : public AK::GenericTraits<Socks5ConnectRequestHeader> { struct AK::Traits<Socks5ConnectRequestHeader> : public AK::DefaultTraits<Socks5ConnectRequestHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
@ -70,7 +70,7 @@ struct [[gnu::packed]] Socks5ConnectRequestTrailer {
}; };
template<> template<>
struct AK::Traits<Socks5ConnectRequestTrailer> : public AK::GenericTraits<Socks5ConnectRequestTrailer> { struct AK::Traits<Socks5ConnectRequestTrailer> : public AK::DefaultTraits<Socks5ConnectRequestTrailer> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
@ -81,7 +81,7 @@ struct [[gnu::packed]] Socks5ConnectResponseHeader {
}; };
template<> template<>
struct AK::Traits<Socks5ConnectResponseHeader> : public AK::GenericTraits<Socks5ConnectResponseHeader> { struct AK::Traits<Socks5ConnectResponseHeader> : public AK::DefaultTraits<Socks5ConnectResponseHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
@ -95,7 +95,7 @@ struct [[gnu::packed]] Socks5UsernamePasswordResponse {
}; };
template<> template<>
struct AK::Traits<Socks5UsernamePasswordResponse> : public AK::GenericTraits<Socks5UsernamePasswordResponse> { struct AK::Traits<Socks5UsernamePasswordResponse> : public AK::DefaultTraits<Socks5UsernamePasswordResponse> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -105,7 +105,7 @@ struct AK::Formatter<Core::SocketAddress> : Formatter<DeprecatedString> {
}; };
template<> template<>
struct AK::Traits<Core::SocketAddress> : public GenericTraits<Core::SocketAddress> { struct AK::Traits<Core::SocketAddress> : public DefaultTraits<Core::SocketAddress> {
static unsigned hash(Core::SocketAddress const& socket_address) static unsigned hash(Core::SocketAddress const& socket_address)
{ {
return pair_int_hash(Traits<IPv4Address>::hash(socket_address.ipv4_address()), Traits<u16>::hash(socket_address.port())); return pair_int_hash(Traits<IPv4Address>::hash(socket_address.ipv4_address()), Traits<u16>::hash(socket_address.port()));

View file

@ -65,7 +65,7 @@ private:
} }
template<> template<>
struct AK::Traits<DNS::Answer> : public GenericTraits<DNS::Answer> { struct AK::Traits<DNS::Answer> : public DefaultTraits<DNS::Answer> {
static constexpr bool is_trivial() { return false; } static constexpr bool is_trivial() { return false; }
static unsigned hash(DNS::Answer a) { return a.hash(); } static unsigned hash(DNS::Answer a) { return a.hash(); }
}; };

View file

@ -99,6 +99,6 @@ static_assert(sizeof(PacketHeader) == 12);
} }
template<> template<>
struct AK::Traits<DNS::PacketHeader> : public AK::GenericTraits<DNS::PacketHeader> { struct AK::Traits<DNS::PacketHeader> : public AK::DefaultTraits<DNS::PacketHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -70,7 +70,7 @@ struct Formatter<GUI::ModelIndex> : Formatter<FormatString> {
}; };
template<> template<>
struct Traits<GUI::ModelIndex> : public GenericTraits<GUI::ModelIndex> { struct Traits<GUI::ModelIndex> : public DefaultTraits<GUI::ModelIndex> {
static unsigned hash(const GUI::ModelIndex& index) static unsigned hash(const GUI::ModelIndex& index)
{ {
return pair_int_hash(pair_int_hash(index.row(), index.column()), reinterpret_cast<FlatPtr>(index.internal_data())); return pair_int_hash(pair_int_hash(index.row(), index.column()), reinterpret_cast<FlatPtr>(index.internal_data()));

View file

@ -81,7 +81,7 @@ struct Formatter<GUI::PersistentModelIndex> : Formatter<FormatString> {
}; };
template<> template<>
struct Traits<GUI::PersistentModelIndex> : public GenericTraits<GUI::PersistentModelIndex> { struct Traits<GUI::PersistentModelIndex> : public DefaultTraits<GUI::PersistentModelIndex> {
static unsigned hash(const GUI::PersistentModelIndex& index) static unsigned hash(const GUI::PersistentModelIndex& index)
{ {
if (index.has_valid_handle()) if (index.has_valid_handle())

View file

@ -80,7 +80,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<GUI::Shortcut> : public GenericTraits<GUI::Shortcut> { struct Traits<GUI::Shortcut> : public DefaultTraits<GUI::Shortcut> {
static unsigned hash(const GUI::Shortcut& shortcut) static unsigned hash(const GUI::Shortcut& shortcut)
{ {
auto base_hash = pair_int_hash(shortcut.modifiers(), (u32)shortcut.type()); auto base_hash = pair_int_hash(shortcut.modifiers(), (u32)shortcut.type());

View file

@ -46,7 +46,7 @@ static constexpr size_t s_max_range_mask_size = s_max_glyph_count / (256 * 8);
// FIXME: We define the traits for the const FontFileHeader, because that's the one we use, and defining // FIXME: We define the traits for the const FontFileHeader, because that's the one we use, and defining
// Traits<T> doesn't apply to Traits<T const>. Once that's fixed, remove the const here. // Traits<T> doesn't apply to Traits<T const>. Once that's fixed, remove the const here.
template<> template<>
class AK::Traits<Gfx::FontFileHeader const> : public GenericTraits<Gfx::FontFileHeader const> { class AK::Traits<Gfx::FontFileHeader const> : public DefaultTraits<Gfx::FontFileHeader const> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -55,19 +55,19 @@ static_assert(AssertSize<Version16Dot16, 4>());
namespace AK { namespace AK {
template<> template<>
struct Traits<OpenType::Fixed const> : public GenericTraits<OpenType::Fixed const> { struct Traits<OpenType::Fixed const> : public DefaultTraits<OpenType::Fixed const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::LongDateTime const> : public GenericTraits<OpenType::LongDateTime const> { struct Traits<OpenType::LongDateTime const> : public DefaultTraits<OpenType::LongDateTime const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::Tag const> : public GenericTraits<OpenType::Tag const> { struct Traits<OpenType::Tag const> : public DefaultTraits<OpenType::Tag const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::Version16Dot16 const> : public GenericTraits<OpenType::Version16Dot16 const> { struct Traits<OpenType::Version16Dot16 const> : public DefaultTraits<OpenType::Version16Dot16 const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
} }

View file

@ -37,7 +37,7 @@ static_assert(AssertSize<TTCHeaderV1, 16>());
} }
template<> template<>
class AK::Traits<OpenType::TTCHeaderV1> : public GenericTraits<OpenType::TTCHeaderV1> { class AK::Traits<OpenType::TTCHeaderV1> : public DefaultTraits<OpenType::TTCHeaderV1> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -48,13 +48,13 @@ static_assert(AssertSize<TableRecord, 16>());
} }
template<> template<>
class AK::Traits<OpenType::TableDirectory const> : public GenericTraits<OpenType::TableDirectory const> { class AK::Traits<OpenType::TableDirectory const> : public DefaultTraits<OpenType::TableDirectory const> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
class AK::Traits<OpenType::TableRecord const> : public GenericTraits<OpenType::TableRecord const> { class AK::Traits<OpenType::TableRecord const> : public DefaultTraits<OpenType::TableRecord const> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
@ -788,47 +788,47 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<OpenType::Kern::Header const> : public GenericTraits<OpenType::Kern::Header const> { struct Traits<OpenType::Kern::Header const> : public DefaultTraits<OpenType::Kern::Header const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::Kern::SubtableHeader const> : public GenericTraits<OpenType::Kern::SubtableHeader const> { struct Traits<OpenType::Kern::SubtableHeader const> : public DefaultTraits<OpenType::Kern::SubtableHeader const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::Kern::Format0 const> : public GenericTraits<OpenType::Kern::Format0 const> { struct Traits<OpenType::Kern::Format0 const> : public DefaultTraits<OpenType::Kern::Format0 const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::Kern::Format0Pair const> : public GenericTraits<OpenType::Kern::Format0Pair const> { struct Traits<OpenType::Kern::Format0Pair const> : public DefaultTraits<OpenType::Kern::Format0Pair const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::GPOS::Version1_0 const> : public GenericTraits<OpenType::GPOS::Version1_0 const> { struct Traits<OpenType::GPOS::Version1_0 const> : public DefaultTraits<OpenType::GPOS::Version1_0 const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::FeatureList const> : public GenericTraits<OpenType::FeatureList const> { struct Traits<OpenType::FeatureList const> : public DefaultTraits<OpenType::FeatureList const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::FeatureRecord const> : public GenericTraits<OpenType::FeatureRecord const> { struct Traits<OpenType::FeatureRecord const> : public DefaultTraits<OpenType::FeatureRecord const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::LookupList const> : public GenericTraits<OpenType::LookupList const> { struct Traits<OpenType::LookupList const> : public DefaultTraits<OpenType::LookupList const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::ScriptList const> : public GenericTraits<OpenType::ScriptList const> { struct Traits<OpenType::ScriptList const> : public DefaultTraits<OpenType::ScriptList const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct Traits<OpenType::ScriptRecord const> : public GenericTraits<OpenType::ScriptRecord const> { struct Traits<OpenType::ScriptRecord const> : public DefaultTraits<OpenType::ScriptRecord const> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
} }

View file

@ -97,7 +97,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Gfx::GlyphIndexWithSubpixelOffset> : public GenericTraits<Gfx::GlyphIndexWithSubpixelOffset> { struct Traits<Gfx::GlyphIndexWithSubpixelOffset> : public DefaultTraits<Gfx::GlyphIndexWithSubpixelOffset> {
static unsigned hash(Gfx::GlyphIndexWithSubpixelOffset const& index) static unsigned hash(Gfx::GlyphIndexWithSubpixelOffset const& index)
{ {
return pair_int_hash(index.glyph_id, (index.subpixel_offset.x << 8) | index.subpixel_offset.y); return pair_int_hash(index.glyph_id, (index.subpixel_offset.x << 8) | index.subpixel_offset.y);

View file

@ -47,13 +47,13 @@ static_assert(AssertSize<TableDirectoryEntry, 20>());
} }
template<> template<>
class AK::Traits<WOFF::Header> : public GenericTraits<WOFF::Header> { class AK::Traits<WOFF::Header> : public DefaultTraits<WOFF::Header> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
class AK::Traits<WOFF::TableDirectoryEntry> : public GenericTraits<WOFF::TableDirectoryEntry> { class AK::Traits<WOFF::TableDirectoryEntry> : public DefaultTraits<WOFF::TableDirectoryEntry> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -42,7 +42,7 @@ static_assert(AssertSize<Header, 48>());
} }
template<> template<>
class AK::Traits<WOFF2::Header> : public GenericTraits<WOFF2::Header> { class AK::Traits<WOFF2::Header> : public DefaultTraits<WOFF2::Header> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
@ -496,7 +496,7 @@ static_assert(AssertSize<TransformedGlyfTable, 36>());
} }
template<> template<>
class AK::Traits<WOFF2::TransformedGlyfTable> : public GenericTraits<WOFF2::TransformedGlyfTable> { class AK::Traits<WOFF2::TransformedGlyfTable> : public DefaultTraits<WOFF2::TransformedGlyfTable> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -65,7 +65,7 @@ struct AK::Formatter<Gfx::ICC::DistinctFourCC<Type>> : StandardFormatter {
}; };
template<Gfx::ICC::FourCCType Type> template<Gfx::ICC::FourCCType Type>
struct AK::Traits<Gfx::ICC::DistinctFourCC<Type>> : public GenericTraits<Gfx::ICC::DistinctFourCC<Type>> { struct AK::Traits<Gfx::ICC::DistinctFourCC<Type>> : public DefaultTraits<Gfx::ICC::DistinctFourCC<Type>> {
static unsigned hash(Gfx::ICC::DistinctFourCC<Type> const& key) static unsigned hash(Gfx::ICC::DistinctFourCC<Type> const& key)
{ {
return int_hash(key.value); return int_hash(key.value);

View file

@ -254,11 +254,11 @@ private:
} }
template<> template<>
struct AK::Traits<Gfx::DDSHeader> : public AK::GenericTraits<Gfx::DDSHeader> { struct AK::Traits<Gfx::DDSHeader> : public AK::DefaultTraits<Gfx::DDSHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
struct AK::Traits<Gfx::DDSHeaderDXT10> : public AK::GenericTraits<Gfx::DDSHeaderDXT10> { struct AK::Traits<Gfx::DDSHeaderDXT10> : public AK::DefaultTraits<Gfx::DDSHeaderDXT10> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -38,13 +38,13 @@ static_assert(AssertSize<ICONDIRENTRY, 16>());
}; };
template<> template<>
class AK::Traits<Gfx::ICONDIR> : public GenericTraits<Gfx::ICONDIR> { class AK::Traits<Gfx::ICONDIR> : public DefaultTraits<Gfx::ICONDIR> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };
template<> template<>
class AK::Traits<Gfx::ICONDIRENTRY> : public GenericTraits<Gfx::ICONDIRENTRY> { class AK::Traits<Gfx::ICONDIRENTRY> : public DefaultTraits<Gfx::ICONDIRENTRY> {
public: public:
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -59,6 +59,6 @@ private:
} }
template<> template<>
struct AK::Traits<Gfx::QOIHeader> : public GenericTraits<Gfx::QOIHeader> { struct AK::Traits<Gfx::QOIHeader> : public DefaultTraits<Gfx::QOIHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -44,7 +44,7 @@ static_assert(sizeof(TGAHeader) == 18);
} }
template<> template<>
struct AK::Traits<Gfx::TGAHeader> : public GenericTraits<Gfx::TGAHeader> { struct AK::Traits<Gfx::TGAHeader> : public DefaultTraits<Gfx::TGAHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -313,7 +313,7 @@ ErrorOr<Gfx::IntPoint> decode(Decoder&);
} }
template<typename T> template<typename T>
struct AK::Traits<Gfx::Point<T>> : public AK::GenericTraits<Gfx::Point<T>> { struct AK::Traits<Gfx::Point<T>> : public AK::DefaultTraits<Gfx::Point<T>> {
static constexpr bool is_trivial() { return false; } static constexpr bool is_trivial() { return false; }
static unsigned hash(Gfx::Point<T> const& point) static unsigned hash(Gfx::Point<T> const& point)
{ {

View file

@ -215,7 +215,7 @@ inline bool operator==(NonnullGCPtr<T> const& a, GCPtr<U> const& b)
namespace AK { namespace AK {
template<typename T> template<typename T>
struct Traits<JS::GCPtr<T>> : public GenericTraits<JS::GCPtr<T>> { struct Traits<JS::GCPtr<T>> : public DefaultTraits<JS::GCPtr<T>> {
static unsigned hash(JS::GCPtr<T> const& value) static unsigned hash(JS::GCPtr<T> const& value)
{ {
return Traits<T*>::hash(value.ptr()); return Traits<T*>::hash(value.ptr());
@ -223,7 +223,7 @@ struct Traits<JS::GCPtr<T>> : public GenericTraits<JS::GCPtr<T>> {
}; };
template<typename T> template<typename T>
struct Traits<JS::NonnullGCPtr<T>> : public GenericTraits<JS::NonnullGCPtr<T>> { struct Traits<JS::NonnullGCPtr<T>> : public DefaultTraits<JS::NonnullGCPtr<T>> {
static unsigned hash(JS::NonnullGCPtr<T> const& value) static unsigned hash(JS::NonnullGCPtr<T> const& value)
{ {
return Traits<T*>::hash(value.ptr()); return Traits<T*>::hash(value.ptr());

View file

@ -195,12 +195,12 @@ inline Handle<Value> make_handle(Value value, SourceLocation location = SourceLo
namespace AK { namespace AK {
template<typename T> template<typename T>
struct Traits<JS::Handle<T>> : public GenericTraits<JS::Handle<T>> { struct Traits<JS::Handle<T>> : public DefaultTraits<JS::Handle<T>> {
static unsigned hash(JS::Handle<T> const& handle) { return Traits<T>::hash(handle); } static unsigned hash(JS::Handle<T> const& handle) { return Traits<T>::hash(handle); }
}; };
template<> template<>
struct Traits<JS::Handle<JS::Value>> : public GenericTraits<JS::Handle<JS::Value>> { struct Traits<JS::Handle<JS::Value>> : public DefaultTraits<JS::Handle<JS::Value>> {
static unsigned hash(JS::Handle<JS::Value> const& handle) { return Traits<JS::Value>::hash(handle.value()); } static unsigned hash(JS::Handle<JS::Value> const& handle) { return Traits<JS::Value>::hash(handle.value()); }
}; };

View file

@ -195,7 +195,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<JS::PropertyKey> : public GenericTraits<JS::PropertyKey> { struct Traits<JS::PropertyKey> : public DefaultTraits<JS::PropertyKey> {
static unsigned hash(JS::PropertyKey const& name) static unsigned hash(JS::PropertyKey const& name)
{ {
VERIFY(name.is_valid()); VERIFY(name.is_valid());

View file

@ -119,7 +119,7 @@ private:
} }
template<> template<>
struct AK::Traits<JS::TransitionKey> : public GenericTraits<JS::TransitionKey> { struct AK::Traits<JS::TransitionKey> : public DefaultTraits<JS::TransitionKey> {
static unsigned hash(const JS::TransitionKey& key) static unsigned hash(const JS::TransitionKey& key)
{ {
return pair_int_hash(key.attributes.bits(), Traits<JS::StringOrSymbol>::hash(key.property_key)); return pair_int_hash(key.attributes.bits(), Traits<JS::StringOrSymbol>::hash(key.property_key));

View file

@ -154,7 +154,7 @@ private:
} }
template<> template<>
struct AK::Traits<JS::StringOrSymbol> : public GenericTraits<JS::StringOrSymbol> { struct AK::Traits<JS::StringOrSymbol> : public DefaultTraits<JS::StringOrSymbol> {
static unsigned hash(JS::StringOrSymbol const& key) static unsigned hash(JS::StringOrSymbol const& key)
{ {
return key.hash(); return key.hash();

View file

@ -706,7 +706,7 @@ struct Formatter<JS::Value> : Formatter<StringView> {
}; };
template<> template<>
struct Traits<JS::Value> : GenericTraits<JS::Value> { struct Traits<JS::Value> : DefaultTraits<JS::Value> {
static unsigned hash(JS::Value value) { return Traits<u64>::hash(value.encoded()); } static unsigned hash(JS::Value value) { return Traits<u64>::hash(value.encoded()); }
}; };

View file

@ -66,13 +66,13 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Line::Key> : public GenericTraits<Line::Key> { struct Traits<Line::Key> : public DefaultTraits<Line::Key> {
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
static unsigned hash(Line::Key k) { return pair_int_hash(k.key, k.modifiers); } static unsigned hash(Line::Key k) { return pair_int_hash(k.key, k.modifiers); }
}; };
template<> template<>
struct Traits<Vector<Line::Key>> : public GenericTraits<Vector<Line::Key>> { struct Traits<Vector<Line::Key>> : public DefaultTraits<Vector<Line::Key>> {
static constexpr bool is_trivial() { return false; } static constexpr bool is_trivial() { return false; }
static unsigned hash(Vector<Line::Key> const& ks) static unsigned hash(Vector<Line::Key> const& ks)
{ {

View file

@ -54,7 +54,7 @@ public:
namespace AK { namespace AK {
template<typename T> template<typename T>
requires(IsBaseOf<Manual::Node, T>) struct Traits<T> : public GenericTraits<T> { requires(IsBaseOf<Manual::Node, T>) struct Traits<T> : public DefaultTraits<T> {
static unsigned hash(T p) { return Traits::hash(p.path()); } static unsigned hash(T p) { return Traits::hash(p.path()); }
}; };

View file

@ -41,7 +41,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<PDF::Type1GlyphCacheKey> : public GenericTraits<PDF::Type1GlyphCacheKey> { struct Traits<PDF::Type1GlyphCacheKey> : public DefaultTraits<PDF::Type1GlyphCacheKey> {
static unsigned hash(PDF::Type1GlyphCacheKey const& index) static unsigned hash(PDF::Type1GlyphCacheKey const& index)
{ {
return pair_int_hash(pair_int_hash(index.glyph_id, (index.subpixel_offset.x << 8) | index.subpixel_offset.y), int_hash(bit_cast<u32>(index.width))); return pair_int_hash(pair_int_hash(index.glyph_id, (index.subpixel_offset.x << 8) | index.subpixel_offset.y), int_hash(bit_cast<u32>(index.width)));

View file

@ -172,7 +172,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<PDF::Renderer::FontCacheKey> : public GenericTraits<PDF::Renderer::FontCacheKey> { struct Traits<PDF::Renderer::FontCacheKey> : public DefaultTraits<PDF::Renderer::FontCacheKey> {
static unsigned hash(PDF::Renderer::FontCacheKey const& key) static unsigned hash(PDF::Renderer::FontCacheKey const& key)
{ {
return pair_int_hash(key.font_dictionary_key.hash(), int_hash(bit_cast<u32>(key.font_size))); return pair_int_hash(key.font_dictionary_key.hash(), int_hash(bit_cast<u32>(key.font_size)));

View file

@ -149,7 +149,7 @@ private:
} }
template<> template<>
struct AK::Traits<Syntax::Highlighter::MatchingTokenPair> : public AK::GenericTraits<Syntax::Highlighter::MatchingTokenPair> { struct AK::Traits<Syntax::Highlighter::MatchingTokenPair> : public AK::DefaultTraits<Syntax::Highlighter::MatchingTokenPair> {
static unsigned hash(Syntax::Highlighter::MatchingTokenPair const& pair) static unsigned hash(Syntax::Highlighter::MatchingTokenPair const& pair)
{ {
return pair_int_hash(u64_hash(pair.open), u64_hash(pair.close)); return pair_int_hash(u64_hash(pair.open), u64_hash(pair.close));

View file

@ -77,6 +77,6 @@ private:
} }
template<> template<>
struct AK::Traits<Video::Track> : public GenericTraits<Video::Track> { struct AK::Traits<Video::Track> : public DefaultTraits<Video::Track> {
static unsigned hash(Video::Track const& t) { return t.hash(); } static unsigned hash(Video::Track const& t) { return t.hash(); }
}; };

View file

@ -670,7 +670,7 @@ private:
} }
template<> template<>
struct AK::Traits<Wasm::Linker::Name> : public AK::GenericTraits<Wasm::Linker::Name> { struct AK::Traits<Wasm::Linker::Name> : public AK::DefaultTraits<Wasm::Linker::Name> {
static constexpr bool is_trivial() { return false; } static constexpr bool is_trivial() { return false; }
static unsigned hash(Wasm::Linker::Name const& entry) { return pair_int_hash(entry.module.hash(), entry.name.hash()); } static unsigned hash(Wasm::Linker::Name const& entry) { return pair_int_hash(entry.module.hash(), entry.name.hash()); }
static bool equals(Wasm::Linker::Name const& a, Wasm::Linker::Name const& b) { return a.name == b.name && a.module == b.module; } static bool equals(Wasm::Linker::Name const& a, Wasm::Linker::Name const& b) { return a.name == b.name && a.module == b.module; }

View file

@ -69,7 +69,7 @@ namespace AK {
// traits for FontFaceKey // traits for FontFaceKey
template<> template<>
struct Traits<Web::CSS::FontFaceKey> : public GenericTraits<Web::CSS::FontFaceKey> { struct Traits<Web::CSS::FontFaceKey> : public DefaultTraits<Web::CSS::FontFaceKey> {
static unsigned hash(Web::CSS::FontFaceKey const& key) { return pair_int_hash(key.family_name.hash(), pair_int_hash(key.weight, key.slope)); } static unsigned hash(Web::CSS::FontFaceKey const& key) { return pair_int_hash(key.family_name.hash(), pair_int_hash(key.weight, key.slope)); }
}; };

View file

@ -250,7 +250,7 @@ private:
} }
template<> template<>
struct AK::Traits<Web::CSS::StyleComputer::AnimationKey> : public AK::GenericTraits<Web::CSS::StyleComputer::AnimationKey> { struct AK::Traits<Web::CSS::StyleComputer::AnimationKey> : public AK::DefaultTraits<Web::CSS::StyleComputer::AnimationKey> {
static unsigned hash(Web::CSS::StyleComputer::AnimationKey const& k) { return pair_int_hash(ptr_hash(k.source_declaration), ptr_hash(k.element)); } static unsigned hash(Web::CSS::StyleComputer::AnimationKey const& k) { return pair_int_hash(ptr_hash(k.source_declaration), ptr_hash(k.element)); }
static bool equals(Web::CSS::StyleComputer::AnimationKey const& a, Web::CSS::StyleComputer::AnimationKey const& b) static bool equals(Web::CSS::StyleComputer::AnimationKey const& a, Web::CSS::StyleComputer::AnimationKey const& b)
{ {

View file

@ -45,7 +45,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::FontSelector> : public GenericTraits<Web::FontSelector> { struct Traits<Web::FontSelector> : public DefaultTraits<Web::FontSelector> {
static unsigned hash(Web::FontSelector const& key) { return pair_int_hash(pair_int_hash(key.family.hash(), key.weight), key.point_size); } static unsigned hash(Web::FontSelector const& key) { return pair_int_hash(pair_int_hash(key.family.hash(), key.weight), key.point_size); }
}; };
} }

View file

@ -34,7 +34,7 @@ using CrossOriginPropertyDescriptorMap = HashMap<CrossOriginKey, JS::PropertyDes
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::HTML::CrossOriginKey> : public GenericTraits<Web::HTML::CrossOriginKey> { struct Traits<Web::HTML::CrossOriginKey> : public DefaultTraits<Web::HTML::CrossOriginKey> {
static unsigned hash(Web::HTML::CrossOriginKey const& key) static unsigned hash(Web::HTML::CrossOriginKey const& key)
{ {
return pair_int_hash( return pair_int_hash(

View file

@ -57,7 +57,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::HTML::ListOfAvailableImages::Key> : public GenericTraits<Web::HTML::ListOfAvailableImages::Key> { struct Traits<Web::HTML::ListOfAvailableImages::Key> : public DefaultTraits<Web::HTML::ListOfAvailableImages::Key> {
static unsigned hash(Web::HTML::ListOfAvailableImages::Key const& key) static unsigned hash(Web::HTML::ListOfAvailableImages::Key const& key)
{ {
return key.hash(); return key.hash();

View file

@ -122,7 +122,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::HTML::Origin> : public GenericTraits<Web::HTML::Origin> { struct Traits<Web::HTML::Origin> : public DefaultTraits<Web::HTML::Origin> {
static unsigned hash(Web::HTML::Origin const& origin) static unsigned hash(Web::HTML::Origin const& origin)
{ {
auto hash_without_host = pair_int_hash(origin.scheme().hash(), origin.port()); auto hash_without_host = pair_int_hash(origin.scheme().hash(), origin.port());

View file

@ -78,7 +78,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::HTML::ModuleLocationTuple> : public GenericTraits<Web::HTML::ModuleLocationTuple> { struct Traits<Web::HTML::ModuleLocationTuple> : public DefaultTraits<Web::HTML::ModuleLocationTuple> {
static unsigned hash(Web::HTML::ModuleLocationTuple const& tuple) static unsigned hash(Web::HTML::ModuleLocationTuple const& tuple)
{ {
return pair_int_hash(tuple.url().to_deprecated_string().hash(), tuple.type().hash()); return pair_int_hash(tuple.url().to_deprecated_string().hash(), tuple.type().hash());

View file

@ -2470,7 +2470,7 @@ CSSPixels GridFormattingContext::calculate_minimum_contribution(GridItem const&
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::Layout::GridPosition> : public GenericTraits<Web::Layout::GridPosition> { struct Traits<Web::Layout::GridPosition> : public DefaultTraits<Web::Layout::GridPosition> {
static unsigned hash(Web::Layout::GridPosition const& key) { return pair_int_hash(key.row, key.column); } static unsigned hash(Web::Layout::GridPosition const& key) { return pair_int_hash(key.row, key.column); }
}; };
} }

View file

@ -89,7 +89,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::Layout::TableGrid::GridPosition> : public GenericTraits<Web::Layout::TableGrid::GridPosition> { struct Traits<Web::Layout::TableGrid::GridPosition> : public DefaultTraits<Web::Layout::TableGrid::GridPosition> {
static unsigned hash(Web::Layout::TableGrid::GridPosition const& key) static unsigned hash(Web::Layout::TableGrid::GridPosition const& key)
{ {
return pair_int_hash(key.x, key.y); return pair_int_hash(key.x, key.y);

View file

@ -88,7 +88,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::LoadRequest> : public GenericTraits<Web::LoadRequest> { struct Traits<Web::LoadRequest> : public DefaultTraits<Web::LoadRequest> {
static unsigned hash(Web::LoadRequest const& request) { return request.hash(); } static unsigned hash(Web::LoadRequest const& request) { return request.hash(); }
}; };

View file

@ -23,7 +23,7 @@ struct CellCoordinates {
namespace AK { namespace AK {
template<> template<>
struct Traits<CellCoordinates> : public GenericTraits<CellCoordinates> { struct Traits<CellCoordinates> : public DefaultTraits<CellCoordinates> {
static unsigned hash(CellCoordinates const& key) { return pair_int_hash(key.row_index, key.column_index); } static unsigned hash(CellCoordinates const& key) { return pair_int_hash(key.row_index, key.column_index); }
}; };
} }

View file

@ -462,7 +462,7 @@ template<>
namespace AK { namespace AK {
template<> template<>
struct Traits<Web::CSSPixels> : public GenericTraits<Web::CSSPixels> { struct Traits<Web::CSSPixels> : public DefaultTraits<Web::CSSPixels> {
static unsigned hash(Web::CSSPixels const& key) static unsigned hash(Web::CSSPixels const& key)
{ {
return Traits<int>::hash(key.raw_value()); return Traits<int>::hash(key.raw_value());
@ -475,7 +475,7 @@ struct Traits<Web::CSSPixels> : public GenericTraits<Web::CSSPixels> {
}; };
template<> template<>
struct Traits<Web::DevicePixels> : public GenericTraits<Web::DevicePixels> { struct Traits<Web::DevicePixels> : public DefaultTraits<Web::DevicePixels> {
static unsigned hash(Web::DevicePixels const& key) static unsigned hash(Web::DevicePixels const& key)
{ {
return Traits<Web::DevicePixels::Type>::hash(key.value()); return Traits<Web::DevicePixels::Type>::hash(key.value());

View file

@ -91,7 +91,7 @@ private:
} }
template<> template<>
struct AK::Traits<WebView::CookieStorageKey> : public AK::GenericTraits<WebView::CookieStorageKey> { struct AK::Traits<WebView::CookieStorageKey> : public AK::DefaultTraits<WebView::CookieStorageKey> {
static unsigned hash(WebView::CookieStorageKey const& key) static unsigned hash(WebView::CookieStorageKey const& key)
{ {
unsigned hash = 0; unsigned hash = 0;

View file

@ -106,7 +106,7 @@ enum class DHCPMessageType : u8 {
}; };
template<> template<>
struct AK::Traits<DHCPOption> : public GenericTraits<DHCPOption> { struct AK::Traits<DHCPOption> : public DefaultTraits<DHCPOption> {
static constexpr bool is_trivial() { return true; } static constexpr bool is_trivial() { return true; }
static unsigned hash(DHCPOption u) { return int_hash((u8)u); } static unsigned hash(DHCPOption u) { return int_hash((u8)u); }
}; };

View file

@ -34,7 +34,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<DeviceMapper::RegisteredDeviceNode> : public GenericTraits<DeviceMapper::RegisteredDeviceNode> { struct Traits<DeviceMapper::RegisteredDeviceNode> : public DefaultTraits<DeviceMapper::RegisteredDeviceNode> {
static unsigned hash(DeviceMapper::RegisteredDeviceNode const& node) static unsigned hash(DeviceMapper::RegisteredDeviceNode const& node)
{ {
return int_hash(node.minor_number().value()); return int_hash(node.minor_number().value());

View file

@ -111,7 +111,7 @@ struct ConnectionKey {
}; };
template<> template<>
struct AK::Traits<RequestServer::ConnectionCache::ConnectionKey> : public AK::GenericTraits<RequestServer::ConnectionCache::ConnectionKey> { struct AK::Traits<RequestServer::ConnectionCache::ConnectionKey> : public AK::DefaultTraits<RequestServer::ConnectionCache::ConnectionKey> {
static u32 hash(RequestServer::ConnectionCache::ConnectionKey const& key) static u32 hash(RequestServer::ConnectionCache::ConnectionKey const& key)
{ {
return pair_int_hash(pair_int_hash(key.proxy_data.host_ipv4, key.proxy_data.port), pair_int_hash(key.hostname.hash(), key.port)); return pair_int_hash(pair_int_hash(key.proxy_data.host_ipv4, key.proxy_data.port), pair_int_hash(key.hostname.hash(), key.port));

View file

@ -39,6 +39,6 @@ private:
} }
template<> template<>
struct AK::Traits<SpiceAgent::ChunkHeader> : public AK::GenericTraits<SpiceAgent::ChunkHeader> { struct AK::Traits<SpiceAgent::ChunkHeader> : public AK::DefaultTraits<SpiceAgent::ChunkHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -48,7 +48,7 @@ private:
} }
template<> template<>
struct AK::Traits<SpiceAgent::MessageHeader> : public AK::GenericTraits<SpiceAgent::MessageHeader> { struct AK::Traits<SpiceAgent::MessageHeader> : public AK::DefaultTraits<SpiceAgent::MessageHeader> {
static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivially_serializable() { return true; }
}; };

View file

@ -37,7 +37,7 @@ private:
namespace AK { namespace AK {
template<> template<>
struct Traits<WindowIdentifier> : public GenericTraits<WindowIdentifier> { struct Traits<WindowIdentifier> : public DefaultTraits<WindowIdentifier> {
static unsigned hash(WindowIdentifier const& w) { return pair_int_hash(w.client_id(), w.window_id()); } static unsigned hash(WindowIdentifier const& w) { return pair_int_hash(w.client_id(), w.window_id()); }
}; };
} }

View file

@ -594,7 +594,7 @@ inline size_t find_offset_into_node(StringView unescaped_text, size_t escaped_of
namespace AK { namespace AK {
template<> template<>
struct Traits<Shell::Shell::RunnablePath> : public GenericTraits<Shell::Shell::RunnablePath> { struct Traits<Shell::Shell::RunnablePath> : public DefaultTraits<Shell::Shell::RunnablePath> {
static constexpr bool is_trivial() { return false; } static constexpr bool is_trivial() { return false; }
static bool equals(Shell::Shell::RunnablePath const& self, Shell::Shell::RunnablePath const& other) static bool equals(Shell::Shell::RunnablePath const& self, Shell::Shell::RunnablePath const& other)

View file

@ -43,7 +43,7 @@ struct VisitedFile {
}; };
template<> template<>
struct AK::Traits<VisitedFile> : public GenericTraits<VisitedFile> { struct AK::Traits<VisitedFile> : public DefaultTraits<VisitedFile> {
static unsigned hash(VisitedFile const& visited_file) static unsigned hash(VisitedFile const& visited_file)
{ {
return pair_int_hash(u64_hash(visited_file.device), u64_hash(visited_file.inode)); return pair_int_hash(u64_hash(visited_file.device), u64_hash(visited_file.inode));

View file

@ -41,7 +41,7 @@ private:
}; };
template<> template<>
struct AK::Traits<Line> : public GenericTraits<Line> { struct AK::Traits<Line> : public DefaultTraits<Line> {
static unsigned hash(Line l) static unsigned hash(Line l)
{ {
if (l.numeric) if (l.numeric)

Some files were not shown because too many files have changed in this diff Show more