1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:37:44 +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:
Tim Schumacher 2023-11-08 20:29:12 +01:00 committed by Tim Flynn
parent ac23ab42b3
commit a2f60911fe
101 changed files with 154 additions and 154 deletions

View file

@ -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);

View file

@ -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; }
};

View file

@ -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;

View file

@ -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;

View file

@ -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; }
};

View file

@ -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; }
};

View file

@ -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; }
};

View file

@ -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; }
};

View file

@ -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()));

View file

@ -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(); }
};

View file

@ -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; }
};

View file

@ -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()));

View file

@ -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())

View file

@ -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());

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
// 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; }
};

View file

@ -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; }
};
}

View file

@ -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; }
};

View file

@ -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; }
};
}

View file

@ -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);

View file

@ -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; }
};

View file

@ -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; }
};

View file

@ -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);

View file

@ -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; }
};

View file

@ -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; }
};

View file

@ -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; }
};

View file

@ -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; }
};

View file

@ -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)
{

View file

@ -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());

View file

@ -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()); }
};

View file

@ -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());

View file

@ -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));

View file

@ -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();

View file

@ -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()); }
};

View file

@ -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)
{

View file

@ -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()); }
};

View file

@ -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)));

View file

@ -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)));

View file

@ -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));

View file

@ -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(); }
};

View file

@ -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; }

View file

@ -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)); }
};

View file

@ -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)
{

View file

@ -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); }
};
}

View file

@ -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(

View file

@ -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();

View file

@ -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());

View file

@ -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());

View file

@ -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); }
};
}

View file

@ -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);

View file

@ -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(); }
};

View file

@ -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); }
};
}

View file

@ -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());

View file

@ -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;