mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
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:
parent
ac23ab42b3
commit
a2f60911fe
Notes:
sideshowbarker
2024-07-17 21:11:12 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/a2f60911fe Pull-request: https://github.com/SerenityOS/serenity/pull/21852
101 changed files with 154 additions and 154 deletions
|
@ -341,7 +341,7 @@ private:
|
|||
}
|
||||
|
||||
template<>
|
||||
struct Traits<ByteBuffer> : public GenericTraits<ByteBuffer> {
|
||||
struct Traits<ByteBuffer> : public DefaultTraits<ByteBuffer> {
|
||||
static unsigned hash(ByteBuffer const& byte_buffer)
|
||||
{
|
||||
return Traits<ReadonlyBytes>::hash(byte_buffer.span());
|
||||
|
|
|
@ -95,7 +95,7 @@ private:
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Traits<DeprecatedFlyString> : public GenericTraits<DeprecatedFlyString> {
|
||||
struct Traits<DeprecatedFlyString> : public DefaultTraits<DeprecatedFlyString> {
|
||||
static unsigned hash(DeprecatedFlyString const& s) { return s.hash(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ private:
|
|||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ private:
|
|||
};
|
||||
|
||||
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)
|
||||
{
|
||||
unsigned hash = 0;
|
||||
|
|
|
@ -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); }
|
||||
|
||||
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 auto hash(DistinctNumeric<T, X, Opts...> const& d) { return Traits<T>::hash(d.value()); }
|
||||
};
|
||||
|
|
|
@ -121,22 +121,22 @@ requires(HasFormatter<T>) struct Formatter<BigEndian<T>> : Formatter<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(); }
|
||||
};
|
||||
|
||||
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(); }
|
||||
};
|
||||
|
||||
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(); }
|
||||
};
|
||||
|
||||
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(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ private:
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Traits<FlyString> : public GenericTraits<FlyString> {
|
||||
struct Traits<FlyString> : public DefaultTraits<FlyString> {
|
||||
static unsigned hash(FlyString const&);
|
||||
};
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ private:
|
|||
static_assert(sizeof(IPv4Address) == 4);
|
||||
|
||||
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())); }
|
||||
};
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ private:
|
|||
static_assert(sizeof(IPv6Address) == 16);
|
||||
|
||||
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.
|
||||
static unsigned hash(IPv6Address const& address) { return sip_hash_bytes<4, 8>({ &address.to_in6_addr_t(), sizeof(address.to_in6_addr_t()) }); }
|
||||
};
|
||||
|
|
|
@ -111,7 +111,7 @@ static_assert(sizeof(MACAddress) == 6u);
|
|||
namespace AK {
|
||||
|
||||
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)); }
|
||||
};
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ inline ErrorOr<NonnullOwnPtr<T>> try_make(Args&&... args)
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
struct Traits<NonnullOwnPtr<T>> : public GenericTraits<NonnullOwnPtr<T>> {
|
||||
struct Traits<NonnullOwnPtr<T>> : public DefaultTraits<NonnullOwnPtr<T>> {
|
||||
using PeekType = T*;
|
||||
using ConstPeekType = T const*;
|
||||
static unsigned hash(NonnullOwnPtr<T> const& p) { return ptr_hash(p.ptr()); }
|
||||
|
|
|
@ -285,7 +285,7 @@ inline NonnullRefPtr<T> make_ref_counted(Args&&... args)
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
struct Traits<NonnullRefPtr<T>> : public GenericTraits<NonnullRefPtr<T>> {
|
||||
struct Traits<NonnullRefPtr<T>> : public DefaultTraits<NonnullRefPtr<T>> {
|
||||
using PeekType = T*;
|
||||
using ConstPeekType = T const*;
|
||||
static unsigned hash(NonnullRefPtr<T> const& p) { return ptr_hash(p.ptr()); }
|
||||
|
|
|
@ -193,7 +193,7 @@ inline OwnPtr<T> adopt_own_if_nonnull(T* object)
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
struct Traits<OwnPtr<T>> : public GenericTraits<OwnPtr<T>> {
|
||||
struct Traits<OwnPtr<T>> : public DefaultTraits<OwnPtr<T>> {
|
||||
using PeekType = T*;
|
||||
using ConstPeekType = T const*;
|
||||
static unsigned hash(OwnPtr<T> const& p) { return ptr_hash(p.ptr()); }
|
||||
|
|
|
@ -293,7 +293,7 @@ struct Formatter<RefPtr<T>> : Formatter<T const*> {
|
|||
};
|
||||
|
||||
template<typename T>
|
||||
struct Traits<RefPtr<T>> : public GenericTraits<RefPtr<T>> {
|
||||
struct Traits<RefPtr<T>> : public DefaultTraits<RefPtr<T>> {
|
||||
using PeekType = T*;
|
||||
using ConstPeekType = T const*;
|
||||
static unsigned hash(RefPtr<T> const& p) { return ptr_hash(p.ptr()); }
|
||||
|
|
|
@ -296,7 +296,7 @@ public:
|
|||
};
|
||||
|
||||
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)
|
||||
{
|
||||
unsigned hash = 0;
|
||||
|
|
|
@ -257,7 +257,7 @@ private:
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Traits<String> : public GenericTraits<String> {
|
||||
struct Traits<String> : public DefaultTraits<String> {
|
||||
static unsigned hash(String const&);
|
||||
};
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ private:
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Traits<StringView> : public GenericTraits<StringView> {
|
||||
struct Traits<StringView> : public DefaultTraits<StringView> {
|
||||
static unsigned hash(StringView s) { return s.hash(); }
|
||||
};
|
||||
|
||||
|
|
16
AK/Traits.h
16
AK/Traits.h
|
@ -16,7 +16,7 @@
|
|||
namespace AK {
|
||||
|
||||
template<typename T>
|
||||
struct GenericTraits {
|
||||
struct DefaultTraits {
|
||||
using PeekType = T&;
|
||||
using ConstPeekType = T const&;
|
||||
static constexpr bool is_trivial() { return false; }
|
||||
|
@ -27,11 +27,11 @@ struct GenericTraits {
|
|||
};
|
||||
|
||||
template<typename T>
|
||||
struct Traits : public GenericTraits<T> {
|
||||
struct Traits : public DefaultTraits<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_trivially_serializable() { return true; }
|
||||
static unsigned hash(T value)
|
||||
|
@ -42,7 +42,7 @@ struct Traits<T> : public GenericTraits<T> {
|
|||
|
||||
#ifndef KERNEL
|
||||
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_trivially_serializable() { return true; }
|
||||
static unsigned hash(T value)
|
||||
|
@ -53,20 +53,20 @@ struct Traits<T> : public GenericTraits<T> {
|
|||
#endif
|
||||
|
||||
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 constexpr bool is_trivial() { return true; }
|
||||
};
|
||||
|
||||
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 constexpr bool is_trivial() { return Traits<UnderlyingType<T>>::is_trivial(); }
|
||||
static constexpr bool is_trivially_serializable() { return Traits<UnderlyingType<T>>::is_trivially_serializable(); }
|
||||
};
|
||||
|
||||
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 constexpr bool equals(T const a, T const b) { return strcmp(a, b); }
|
||||
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
|
||||
using AK::GenericTraits;
|
||||
using AK::DefaultTraits;
|
||||
using AK::Traits;
|
||||
#endif
|
||||
|
|
|
@ -581,7 +581,7 @@ private:
|
|||
};
|
||||
|
||||
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_trivial() { return true; }
|
||||
};
|
||||
|
|
2
AK/URL.h
2
AK/URL.h
|
@ -197,7 +197,7 @@ struct Formatter<URL> : Formatter<StringView> {
|
|||
};
|
||||
|
||||
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(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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()); }
|
||||
};
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ struct Formatter<NonnullOwnPtr<Kernel::KString>> : Formatter<StringView> {
|
|||
};
|
||||
|
||||
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 ConstPeekType = Kernel::KString const*;
|
||||
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<>
|
||||
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 ConstPeekType = Kernel::KString const*;
|
||||
static unsigned hash(OwnPtr<Kernel::KString> const& p)
|
||||
|
|
|
@ -460,7 +460,7 @@ struct Formatter<LockRefPtr<T>> : Formatter<T const*> {
|
|||
};
|
||||
|
||||
template<typename T>
|
||||
struct Traits<LockRefPtr<T>> : public GenericTraits<LockRefPtr<T>> {
|
||||
struct Traits<LockRefPtr<T>> : public DefaultTraits<LockRefPtr<T>> {
|
||||
using PeekType = T*;
|
||||
using ConstPeekType = T const*;
|
||||
static unsigned hash(LockRefPtr<T> const& p) { return ptr_hash(p.ptr()); }
|
||||
|
|
|
@ -329,7 +329,7 @@ requires(IsConvertible<U*, T*>)
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
struct Traits<NonnullLockRefPtr<T>> : public GenericTraits<NonnullLockRefPtr<T>> {
|
||||
struct Traits<NonnullLockRefPtr<T>> : public DefaultTraits<NonnullLockRefPtr<T>> {
|
||||
using PeekType = T*;
|
||||
using ConstPeekType = T const*;
|
||||
static unsigned hash(NonnullLockRefPtr<T> const& p) { return ptr_hash(p.ptr()); }
|
||||
|
|
|
@ -56,7 +56,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<Kernel::IPv4SocketTuple> : public GenericTraits<Kernel::IPv4SocketTuple> {
|
||||
struct Traits<Kernel::IPv4SocketTuple> : public DefaultTraits<Kernel::IPv4SocketTuple> {
|
||||
static unsigned hash(Kernel::IPv4SocketTuple const& tuple)
|
||||
{
|
||||
auto h1 = pair_int_hash(tuple.local_address().to_u32(), tuple.local_port());
|
||||
|
|
|
@ -1098,7 +1098,7 @@ struct AK::Formatter<Kernel::Process> : AK::Formatter<FormatString> {
|
|||
|
||||
namespace AK {
|
||||
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 bool equals(Kernel::GlobalFutexKey const& a, Kernel::GlobalFutexKey const& b) { return a.raw.parent == b.raw.parent && a.raw.offset == b.raw.offset; }
|
||||
};
|
||||
|
|
|
@ -28,7 +28,7 @@ static NSString* const CSS_PROPERTY_COLUMN = @"Property";
|
|||
static NSString* const CSS_VALUE_COLUMN = @"Value";
|
||||
|
||||
template<>
|
||||
struct AK::Traits<NSDictionary*> : public GenericTraits<NSDictionary*> {
|
||||
struct AK::Traits<NSDictionary*> : public DefaultTraits<NSDictionary*> {
|
||||
static unsigned hash(NSDictionary* dictionary)
|
||||
{
|
||||
return [dictionary hash];
|
||||
|
|
|
@ -118,7 +118,7 @@ struct AK::Formatter<CalendarPattern> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<CalendarPattern> : public GenericTraits<CalendarPattern> {
|
||||
struct AK::Traits<CalendarPattern> : public DefaultTraits<CalendarPattern> {
|
||||
static unsigned hash(CalendarPattern const& c) { return c.hash(); }
|
||||
};
|
||||
|
||||
|
@ -185,7 +185,7 @@ struct AK::Formatter<CalendarRangePattern> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<CalendarRangePattern> : public GenericTraits<CalendarRangePattern> {
|
||||
struct AK::Traits<CalendarRangePattern> : public DefaultTraits<CalendarRangePattern> {
|
||||
static unsigned hash(CalendarRangePattern const& c) { return c.hash(); }
|
||||
};
|
||||
|
||||
|
@ -226,7 +226,7 @@ struct AK::Formatter<CalendarFormat> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<CalendarFormat> : public GenericTraits<CalendarFormat> {
|
||||
struct AK::Traits<CalendarFormat> : public DefaultTraits<CalendarFormat> {
|
||||
static unsigned hash(CalendarFormat const& c) { return c.hash(); }
|
||||
};
|
||||
|
||||
|
@ -265,7 +265,7 @@ struct AK::Formatter<CalendarSymbols> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<CalendarSymbols> : public GenericTraits<CalendarSymbols> {
|
||||
struct AK::Traits<CalendarSymbols> : public DefaultTraits<CalendarSymbols> {
|
||||
static unsigned hash(CalendarSymbols const& c) { return c.hash(); }
|
||||
};
|
||||
|
||||
|
@ -329,7 +329,7 @@ struct AK::Formatter<Calendar> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<Calendar> : public GenericTraits<Calendar> {
|
||||
struct AK::Traits<Calendar> : public DefaultTraits<Calendar> {
|
||||
static unsigned hash(Calendar const& c) { return c.hash(); }
|
||||
};
|
||||
|
||||
|
@ -381,7 +381,7 @@ struct AK::Formatter<TimeZoneNames> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<TimeZoneNames> : public GenericTraits<TimeZoneNames> {
|
||||
struct AK::Traits<TimeZoneNames> : public DefaultTraits<TimeZoneNames> {
|
||||
static unsigned hash(TimeZoneNames const& t) { return t.hash(); }
|
||||
};
|
||||
|
||||
|
@ -432,7 +432,7 @@ struct AK::Formatter<TimeZoneFormat> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<TimeZoneFormat> : public GenericTraits<TimeZoneFormat> {
|
||||
struct AK::Traits<TimeZoneFormat> : public DefaultTraits<TimeZoneFormat> {
|
||||
static unsigned hash(TimeZoneFormat const& t) { return t.hash(); }
|
||||
};
|
||||
|
||||
|
@ -470,7 +470,7 @@ struct AK::Formatter<DayPeriod> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<DayPeriod> : public GenericTraits<DayPeriod> {
|
||||
struct AK::Traits<DayPeriod> : public DefaultTraits<DayPeriod> {
|
||||
static unsigned hash(DayPeriod const& d) { return d.hash(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ struct AK::Formatter<DisplayPattern> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<DisplayPattern> : public GenericTraits<DisplayPattern> {
|
||||
struct AK::Traits<DisplayPattern> : public DefaultTraits<DisplayPattern> {
|
||||
static unsigned hash(DisplayPattern const& p) { return p.hash(); }
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,7 @@ struct AK::Formatter<ListPatterns> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<ListPatterns> : public GenericTraits<ListPatterns> {
|
||||
struct AK::Traits<ListPatterns> : public DefaultTraits<ListPatterns> {
|
||||
static unsigned hash(ListPatterns const& p) { return p.hash(); }
|
||||
};
|
||||
|
||||
|
@ -139,7 +139,7 @@ struct AK::Formatter<TextLayout> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<TextLayout> : public GenericTraits<TextLayout> {
|
||||
struct AK::Traits<TextLayout> : public DefaultTraits<TextLayout> {
|
||||
static unsigned hash(TextLayout const& t) { return t.hash(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ struct AK::Formatter<NumberFormat> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<NumberFormat> : public GenericTraits<NumberFormat> {
|
||||
struct AK::Traits<NumberFormat> : public DefaultTraits<NumberFormat> {
|
||||
static unsigned hash(NumberFormat const& f) { return f.hash(); }
|
||||
};
|
||||
|
||||
|
@ -167,7 +167,7 @@ struct AK::Formatter<NumberSystem> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<NumberSystem> : public GenericTraits<NumberSystem> {
|
||||
struct AK::Traits<NumberSystem> : public DefaultTraits<NumberSystem> {
|
||||
static unsigned hash(NumberSystem const& s) { return s.hash(); }
|
||||
};
|
||||
|
||||
|
@ -209,7 +209,7 @@ struct AK::Formatter<Unit> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<Unit> : public GenericTraits<Unit> {
|
||||
struct AK::Traits<Unit> : public DefaultTraits<Unit> {
|
||||
static unsigned hash(Unit const& u) { return u.hash(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ struct AK::Formatter<RelativeTimeFormat> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<RelativeTimeFormat> : public GenericTraits<RelativeTimeFormat> {
|
||||
struct AK::Traits<RelativeTimeFormat> : public DefaultTraits<RelativeTimeFormat> {
|
||||
static unsigned hash(RelativeTimeFormat const& format) { return format.hash(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ template<typename T>
|
|||
concept IntegralOrEnum = Integral<T> || Enum<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)
|
||||
{
|
||||
auto hash = int_hash(static_cast<u32>(list.size()));
|
||||
|
|
|
@ -230,7 +230,7 @@ bool property_has_quirk(PropertyID, Quirk);
|
|||
|
||||
namespace AK {
|
||||
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); }
|
||||
};
|
||||
} // namespace AK
|
||||
|
|
|
@ -155,7 +155,7 @@ TEST_CASE(many_strings)
|
|||
|
||||
TEST_CASE(many_collisions)
|
||||
{
|
||||
struct StringCollisionTraits : public GenericTraits<DeprecatedString> {
|
||||
struct StringCollisionTraits : public DefaultTraits<DeprecatedString> {
|
||||
static unsigned hash(DeprecatedString const&) { return 0; }
|
||||
};
|
||||
|
||||
|
@ -176,7 +176,7 @@ TEST_CASE(many_collisions)
|
|||
|
||||
TEST_CASE(space_reuse)
|
||||
{
|
||||
struct StringCollisionTraits : public GenericTraits<DeprecatedString> {
|
||||
struct StringCollisionTraits : public DefaultTraits<DeprecatedString> {
|
||||
static unsigned hash(DeprecatedString const&) { return 0; }
|
||||
};
|
||||
|
||||
|
|
|
@ -200,6 +200,6 @@ private:
|
|||
}
|
||||
|
||||
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(); }
|
||||
};
|
||||
|
|
|
@ -179,7 +179,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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 unsigned hash(Spreadsheet::Position const& p)
|
||||
{
|
||||
|
|
|
@ -69,7 +69,7 @@ private:
|
|||
|
||||
namespace AK {
|
||||
template<>
|
||||
struct Traits<UserspaceEmulator::Range> : public GenericTraits<UserspaceEmulator::Range> {
|
||||
struct Traits<UserspaceEmulator::Range> : public DefaultTraits<UserspaceEmulator::Range> {
|
||||
static constexpr bool is_trivial() { return true; }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ private:
|
|||
|
||||
namespace AK {
|
||||
template<>
|
||||
struct Traits<Marble> : public GenericTraits<Marble> {
|
||||
struct Traits<Marble> : public DefaultTraits<Marble> {
|
||||
static unsigned hash(Marble const& marble)
|
||||
{
|
||||
return Traits<Marble::Point>::hash(marble.position());
|
||||
|
|
|
@ -97,7 +97,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(ptr_hash(key.font), key.code_point);
|
||||
|
|
|
@ -157,6 +157,6 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -293,7 +293,7 @@ void Board::generate_moves(Callback callback, Color color) const
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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<>
|
||||
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)
|
||||
{
|
||||
unsigned hash = 0;
|
||||
|
|
|
@ -189,7 +189,7 @@ void CppComprehensionEngine::for_each_included_document_recursive(DocumentData c
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
unsigned hash = 0;
|
||||
|
|
|
@ -271,6 +271,6 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -162,16 +162,16 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -88,6 +88,6 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@ struct [[gnu::packed]] Socks5VersionIdentifierAndMethodSelectionMessage {
|
|||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
@ -50,7 +50,7 @@ struct [[gnu::packed]] Socks5InitialResponse {
|
|||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
@ -61,7 +61,7 @@ struct [[gnu::packed]] Socks5ConnectRequestHeader {
|
|||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
@ -70,7 +70,7 @@ struct [[gnu::packed]] Socks5ConnectRequestTrailer {
|
|||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
@ -81,7 +81,7 @@ struct [[gnu::packed]] Socks5ConnectResponseHeader {
|
|||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
@ -95,7 +95,7 @@ struct [[gnu::packed]] Socks5UsernamePasswordResponse {
|
|||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ struct AK::Formatter<Core::SocketAddress> : Formatter<DeprecatedString> {
|
|||
};
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(Traits<IPv4Address>::hash(socket_address.ipv4_address()), Traits<u16>::hash(socket_address.port()));
|
||||
|
|
|
@ -65,7 +65,7 @@ private:
|
|||
}
|
||||
|
||||
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 unsigned hash(DNS::Answer a) { return a.hash(); }
|
||||
};
|
||||
|
|
|
@ -99,6 +99,6 @@ static_assert(sizeof(PacketHeader) == 12);
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -70,7 +70,7 @@ struct Formatter<GUI::ModelIndex> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Traits<GUI::ModelIndex> : public GenericTraits<GUI::ModelIndex> {
|
||||
struct Traits<GUI::ModelIndex> : public DefaultTraits<GUI::ModelIndex> {
|
||||
static unsigned hash(const GUI::ModelIndex& index)
|
||||
{
|
||||
return pair_int_hash(pair_int_hash(index.row(), index.column()), reinterpret_cast<FlatPtr>(index.internal_data()));
|
||||
|
|
|
@ -81,7 +81,7 @@ struct Formatter<GUI::PersistentModelIndex> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Traits<GUI::PersistentModelIndex> : public GenericTraits<GUI::PersistentModelIndex> {
|
||||
struct Traits<GUI::PersistentModelIndex> : public DefaultTraits<GUI::PersistentModelIndex> {
|
||||
static unsigned hash(const GUI::PersistentModelIndex& index)
|
||||
{
|
||||
if (index.has_valid_handle())
|
||||
|
|
|
@ -80,7 +80,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<GUI::Shortcut> : public GenericTraits<GUI::Shortcut> {
|
||||
struct Traits<GUI::Shortcut> : public DefaultTraits<GUI::Shortcut> {
|
||||
static unsigned hash(const GUI::Shortcut& shortcut)
|
||||
{
|
||||
auto base_hash = pair_int_hash(shortcut.modifiers(), (u32)shortcut.type());
|
||||
|
|
|
@ -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
|
||||
// Traits<T> doesn't apply to Traits<T const>. Once that's fixed, remove the const here.
|
||||
template<>
|
||||
class AK::Traits<Gfx::FontFileHeader const> : public GenericTraits<Gfx::FontFileHeader const> {
|
||||
class AK::Traits<Gfx::FontFileHeader const> : public DefaultTraits<Gfx::FontFileHeader const> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
|
|
@ -55,19 +55,19 @@ static_assert(AssertSize<Version16Dot16, 4>());
|
|||
|
||||
namespace AK {
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ static_assert(AssertSize<TTCHeaderV1, 16>());
|
|||
}
|
||||
|
||||
template<>
|
||||
class AK::Traits<OpenType::TTCHeaderV1> : public GenericTraits<OpenType::TTCHeaderV1> {
|
||||
class AK::Traits<OpenType::TTCHeaderV1> : public DefaultTraits<OpenType::TTCHeaderV1> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
|
|
@ -48,13 +48,13 @@ static_assert(AssertSize<TableRecord, 16>());
|
|||
}
|
||||
|
||||
template<>
|
||||
class AK::Traits<OpenType::TableDirectory const> : public GenericTraits<OpenType::TableDirectory const> {
|
||||
class AK::Traits<OpenType::TableDirectory const> : public DefaultTraits<OpenType::TableDirectory const> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
||||
template<>
|
||||
class AK::Traits<OpenType::TableRecord const> : public GenericTraits<OpenType::TableRecord const> {
|
||||
class AK::Traits<OpenType::TableRecord const> : public DefaultTraits<OpenType::TableRecord const> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
@ -788,47 +788,47 @@ private:
|
|||
|
||||
namespace AK {
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
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; }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<Gfx::GlyphIndexWithSubpixelOffset> : public GenericTraits<Gfx::GlyphIndexWithSubpixelOffset> {
|
||||
struct Traits<Gfx::GlyphIndexWithSubpixelOffset> : public DefaultTraits<Gfx::GlyphIndexWithSubpixelOffset> {
|
||||
static unsigned hash(Gfx::GlyphIndexWithSubpixelOffset const& index)
|
||||
{
|
||||
return pair_int_hash(index.glyph_id, (index.subpixel_offset.x << 8) | index.subpixel_offset.y);
|
||||
|
|
|
@ -47,13 +47,13 @@ static_assert(AssertSize<TableDirectoryEntry, 20>());
|
|||
}
|
||||
|
||||
template<>
|
||||
class AK::Traits<WOFF::Header> : public GenericTraits<WOFF::Header> {
|
||||
class AK::Traits<WOFF::Header> : public DefaultTraits<WOFF::Header> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
||||
template<>
|
||||
class AK::Traits<WOFF::TableDirectoryEntry> : public GenericTraits<WOFF::TableDirectoryEntry> {
|
||||
class AK::Traits<WOFF::TableDirectoryEntry> : public DefaultTraits<WOFF::TableDirectoryEntry> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
|
|
@ -42,7 +42,7 @@ static_assert(AssertSize<Header, 48>());
|
|||
}
|
||||
|
||||
template<>
|
||||
class AK::Traits<WOFF2::Header> : public GenericTraits<WOFF2::Header> {
|
||||
class AK::Traits<WOFF2::Header> : public DefaultTraits<WOFF2::Header> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
@ -496,7 +496,7 @@ static_assert(AssertSize<TransformedGlyfTable, 36>());
|
|||
}
|
||||
|
||||
template<>
|
||||
class AK::Traits<WOFF2::TransformedGlyfTable> : public GenericTraits<WOFF2::TransformedGlyfTable> {
|
||||
class AK::Traits<WOFF2::TransformedGlyfTable> : public DefaultTraits<WOFF2::TransformedGlyfTable> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
|
|
@ -65,7 +65,7 @@ struct AK::Formatter<Gfx::ICC::DistinctFourCC<Type>> : StandardFormatter {
|
|||
};
|
||||
|
||||
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)
|
||||
{
|
||||
return int_hash(key.value);
|
||||
|
|
|
@ -254,11 +254,11 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -38,13 +38,13 @@ static_assert(AssertSize<ICONDIRENTRY, 16>());
|
|||
};
|
||||
|
||||
template<>
|
||||
class AK::Traits<Gfx::ICONDIR> : public GenericTraits<Gfx::ICONDIR> {
|
||||
class AK::Traits<Gfx::ICONDIR> : public DefaultTraits<Gfx::ICONDIR> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
||||
template<>
|
||||
class AK::Traits<Gfx::ICONDIRENTRY> : public GenericTraits<Gfx::ICONDIRENTRY> {
|
||||
class AK::Traits<Gfx::ICONDIRENTRY> : public DefaultTraits<Gfx::ICONDIRENTRY> {
|
||||
public:
|
||||
static constexpr bool is_trivially_serializable() { return true; }
|
||||
};
|
||||
|
|
|
@ -59,6 +59,6 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@ static_assert(sizeof(TGAHeader) == 18);
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ ErrorOr<Gfx::IntPoint> decode(Decoder&);
|
|||
}
|
||||
|
||||
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 unsigned hash(Gfx::Point<T> const& point)
|
||||
{
|
||||
|
|
|
@ -215,7 +215,7 @@ inline bool operator==(NonnullGCPtr<T> const& a, GCPtr<U> const& b)
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
return Traits<T*>::hash(value.ptr());
|
||||
|
@ -223,7 +223,7 @@ struct Traits<JS::GCPtr<T>> : public GenericTraits<JS::GCPtr<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)
|
||||
{
|
||||
return Traits<T*>::hash(value.ptr());
|
||||
|
|
|
@ -195,12 +195,12 @@ inline Handle<Value> make_handle(Value value, SourceLocation location = SourceLo
|
|||
namespace AK {
|
||||
|
||||
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); }
|
||||
};
|
||||
|
||||
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()); }
|
||||
};
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<JS::PropertyKey> : public GenericTraits<JS::PropertyKey> {
|
||||
struct Traits<JS::PropertyKey> : public DefaultTraits<JS::PropertyKey> {
|
||||
static unsigned hash(JS::PropertyKey const& name)
|
||||
{
|
||||
VERIFY(name.is_valid());
|
||||
|
|
|
@ -119,7 +119,7 @@ private:
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(key.attributes.bits(), Traits<JS::StringOrSymbol>::hash(key.property_key));
|
||||
|
|
|
@ -154,7 +154,7 @@ private:
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return key.hash();
|
||||
|
|
|
@ -706,7 +706,7 @@ struct Formatter<JS::Value> : Formatter<StringView> {
|
|||
};
|
||||
|
||||
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()); }
|
||||
};
|
||||
|
||||
|
|
|
@ -66,13 +66,13 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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 unsigned hash(Line::Key k) { return pair_int_hash(k.key, k.modifiers); }
|
||||
};
|
||||
|
||||
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 unsigned hash(Vector<Line::Key> const& ks)
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
namespace AK {
|
||||
|
||||
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()); }
|
||||
};
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<PDF::Type1GlyphCacheKey> : public GenericTraits<PDF::Type1GlyphCacheKey> {
|
||||
struct Traits<PDF::Type1GlyphCacheKey> : public DefaultTraits<PDF::Type1GlyphCacheKey> {
|
||||
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)));
|
||||
|
|
|
@ -172,7 +172,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(key.font_dictionary_key.hash(), int_hash(bit_cast<u32>(key.font_size)));
|
||||
|
|
|
@ -149,7 +149,7 @@ private:
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(u64_hash(pair.open), u64_hash(pair.close));
|
||||
|
|
|
@ -77,6 +77,6 @@ private:
|
|||
}
|
||||
|
||||
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(); }
|
||||
};
|
||||
|
|
|
@ -670,7 +670,7 @@ private:
|
|||
}
|
||||
|
||||
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 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; }
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace AK {
|
|||
|
||||
// traits for FontFaceKey
|
||||
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)); }
|
||||
};
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ private:
|
|||
}
|
||||
|
||||
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 bool equals(Web::CSS::StyleComputer::AnimationKey const& a, Web::CSS::StyleComputer::AnimationKey const& b)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ private:
|
|||
|
||||
namespace AK {
|
||||
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); }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ using CrossOriginPropertyDescriptorMap = HashMap<CrossOriginKey, JS::PropertyDes
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(
|
||||
|
|
|
@ -57,7 +57,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
return key.hash();
|
||||
|
|
|
@ -122,7 +122,7 @@ private:
|
|||
|
||||
namespace AK {
|
||||
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)
|
||||
{
|
||||
auto hash_without_host = pair_int_hash(origin.scheme().hash(), origin.port());
|
||||
|
|
|
@ -78,7 +78,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(tuple.url().to_deprecated_string().hash(), tuple.type().hash());
|
||||
|
|
|
@ -2470,7 +2470,7 @@ CSSPixels GridFormattingContext::calculate_minimum_contribution(GridItem const&
|
|||
|
||||
namespace AK {
|
||||
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); }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(key.x, key.y);
|
||||
|
|
|
@ -88,7 +88,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
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(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ struct CellCoordinates {
|
|||
|
||||
namespace AK {
|
||||
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); }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -462,7 +462,7 @@ template<>
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<Web::CSSPixels> : public GenericTraits<Web::CSSPixels> {
|
||||
struct Traits<Web::CSSPixels> : public DefaultTraits<Web::CSSPixels> {
|
||||
static unsigned hash(Web::CSSPixels const& key)
|
||||
{
|
||||
return Traits<int>::hash(key.raw_value());
|
||||
|
@ -475,7 +475,7 @@ struct Traits<Web::CSSPixels> : public GenericTraits<Web::CSSPixels> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Traits<Web::DevicePixels> : public GenericTraits<Web::DevicePixels> {
|
||||
struct Traits<Web::DevicePixels> : public DefaultTraits<Web::DevicePixels> {
|
||||
static unsigned hash(Web::DevicePixels const& key)
|
||||
{
|
||||
return Traits<Web::DevicePixels::Type>::hash(key.value());
|
||||
|
|
|
@ -91,7 +91,7 @@ private:
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
unsigned hash = 0;
|
||||
|
|
|
@ -106,7 +106,7 @@ enum class DHCPMessageType : u8 {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<DHCPOption> : public GenericTraits<DHCPOption> {
|
||||
struct AK::Traits<DHCPOption> : public DefaultTraits<DHCPOption> {
|
||||
static constexpr bool is_trivial() { return true; }
|
||||
static unsigned hash(DHCPOption u) { return int_hash((u8)u); }
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ private:
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Traits<DeviceMapper::RegisteredDeviceNode> : public GenericTraits<DeviceMapper::RegisteredDeviceNode> {
|
||||
struct Traits<DeviceMapper::RegisteredDeviceNode> : public DefaultTraits<DeviceMapper::RegisteredDeviceNode> {
|
||||
static unsigned hash(DeviceMapper::RegisteredDeviceNode const& node)
|
||||
{
|
||||
return int_hash(node.minor_number().value());
|
||||
|
|
|
@ -111,7 +111,7 @@ struct ConnectionKey {
|
|||
};
|
||||
|
||||
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)
|
||||
{
|
||||
return pair_int_hash(pair_int_hash(key.proxy_data.host_ipv4, key.proxy_data.port), pair_int_hash(key.hostname.hash(), key.port));
|
||||
|
|
|
@ -39,6 +39,6 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
|
|
@ -48,7 +48,7 @@ private:
|
|||
}
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ private:
|
|||
|
||||
namespace AK {
|
||||
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()); }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -594,7 +594,7 @@ inline size_t find_offset_into_node(StringView unescaped_text, size_t escaped_of
|
|||
namespace AK {
|
||||
|
||||
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 bool equals(Shell::Shell::RunnablePath const& self, Shell::Shell::RunnablePath const& other)
|
||||
|
|
|
@ -43,7 +43,7 @@ struct VisitedFile {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<VisitedFile> : public GenericTraits<VisitedFile> {
|
||||
struct AK::Traits<VisitedFile> : public DefaultTraits<VisitedFile> {
|
||||
static unsigned hash(VisitedFile const& visited_file)
|
||||
{
|
||||
return pair_int_hash(u64_hash(visited_file.device), u64_hash(visited_file.inode));
|
||||
|
|
|
@ -41,7 +41,7 @@ private:
|
|||
};
|
||||
|
||||
template<>
|
||||
struct AK::Traits<Line> : public GenericTraits<Line> {
|
||||
struct AK::Traits<Line> : public DefaultTraits<Line> {
|
||||
static unsigned hash(Line l)
|
||||
{
|
||||
if (l.numeric)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue