From a2f60911fefb6b46d4194ae775bdd4fd49787370 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Wed, 8 Nov 2023 20:29:12 +0100 Subject: [PATCH] AK: Rename GenericTraits to DefaultTraits This feels like a more fitting name for something that provides the default values for Traits. --- AK/ByteBuffer.h | 2 +- AK/DeprecatedFlyString.h | 2 +- AK/DeprecatedString.h | 2 +- AK/DisjointChunks.h | 2 +- AK/DistinctNumeric.h | 2 +- AK/Endian.h | 8 +++---- AK/FlyString.h | 2 +- AK/IPv4Address.h | 2 +- AK/IPv6Address.h | 2 +- AK/MACAddress.h | 2 +- AK/NonnullOwnPtr.h | 2 +- AK/NonnullRefPtr.h | 2 +- AK/OwnPtr.h | 2 +- AK/RefPtr.h | 2 +- AK/Span.h | 2 +- AK/String.h | 2 +- AK/StringView.h | 2 +- AK/Traits.h | 16 ++++++------- AK/UFixedBigInt.h | 2 +- AK/URL.h | 2 +- Kernel/FileSystem/FileSystem.h | 2 +- Kernel/Library/KString.h | 4 ++-- Kernel/Library/LockRefPtr.h | 2 +- Kernel/Library/NonnullLockRefPtr.h | 2 +- Kernel/Net/IPv4SocketTuple.h | 2 +- Kernel/Tasks/Process.h | 2 +- Ladybird/AppKit/UI/Inspector.mm | 2 +- .../LibLocale/GenerateDateTimeFormatData.cpp | 16 ++++++------- .../LibLocale/GenerateLocaleData.cpp | 6 ++--- .../LibLocale/GenerateNumberFormatData.cpp | 6 ++--- .../GenerateRelativeTimeFormatData.cpp | 2 +- .../CodeGenerators/LibUnicode/GeneratorUtil.h | 2 +- .../LibWeb/GenerateCSSPropertyID.cpp | 2 +- Tests/AK/TestHashTable.cpp | 4 ++-- Userland/Applications/Maps/MapWidget.h | 2 +- .../Applications/Spreadsheet/Spreadsheet.h | 2 +- Userland/DevTools/UserspaceEmulator/Range.h | 2 +- Userland/Games/ColorLines/Marble.h | 2 +- Userland/Libraries/LibAccelGfx/Painter.h | 2 +- Userland/Libraries/LibArchive/Tar.h | 2 +- Userland/Libraries/LibChess/Chess.h | 4 ++-- .../Cpp/CppComprehensionEngine.h | 2 +- Userland/Libraries/LibCompress/Lzma.h | 2 +- Userland/Libraries/LibCompress/Xz.h | 6 ++--- Userland/Libraries/LibCompress/Zlib.h | 2 +- .../Libraries/LibCore/SOCKSProxyClient.cpp | 12 +++++----- Userland/Libraries/LibCore/SocketAddress.h | 2 +- Userland/Libraries/LibDNS/Answer.h | 2 +- Userland/Libraries/LibDNS/PacketHeader.h | 2 +- Userland/Libraries/LibGUI/ModelIndex.h | 2 +- .../Libraries/LibGUI/PersistentModelIndex.h | 2 +- Userland/Libraries/LibGUI/Shortcut.h | 2 +- Userland/Libraries/LibGfx/Font/BitmapFont.cpp | 2 +- .../LibGfx/Font/OpenType/DataTypes.h | 8 +++---- .../Libraries/LibGfx/Font/OpenType/Font.cpp | 2 +- .../Libraries/LibGfx/Font/OpenType/Tables.h | 24 +++++++++---------- Userland/Libraries/LibGfx/Font/ScaledFont.h | 2 +- Userland/Libraries/LibGfx/Font/WOFF/Font.cpp | 4 ++-- Userland/Libraries/LibGfx/Font/WOFF2/Font.cpp | 4 ++-- .../Libraries/LibGfx/ICC/DistinctFourCC.h | 2 +- .../Libraries/LibGfx/ImageFormats/DDSLoader.h | 4 ++-- .../LibGfx/ImageFormats/ICOLoader.cpp | 4 ++-- .../Libraries/LibGfx/ImageFormats/QOILoader.h | 2 +- .../LibGfx/ImageFormats/TGALoader.cpp | 2 +- Userland/Libraries/LibGfx/Point.h | 2 +- Userland/Libraries/LibJS/Heap/GCPtr.h | 4 ++-- Userland/Libraries/LibJS/Heap/Handle.h | 4 ++-- .../Libraries/LibJS/Runtime/PropertyKey.h | 2 +- Userland/Libraries/LibJS/Runtime/Shape.h | 2 +- .../Libraries/LibJS/Runtime/StringOrSymbol.h | 2 +- Userland/Libraries/LibJS/Runtime/Value.h | 2 +- .../Libraries/LibLine/KeyCallbackMachine.h | 4 ++-- Userland/Libraries/LibManual/Node.h | 2 +- Userland/Libraries/LibPDF/Fonts/Type1Font.h | 2 +- Userland/Libraries/LibPDF/Renderer.h | 2 +- Userland/Libraries/LibSyntax/Highlighter.h | 2 +- Userland/Libraries/LibVideo/Track.h | 2 +- .../LibWasm/AbstractMachine/AbstractMachine.h | 2 +- .../Libraries/LibWeb/CSS/StyleComputer.cpp | 2 +- Userland/Libraries/LibWeb/CSS/StyleComputer.h | 2 +- Userland/Libraries/LibWeb/FontCache.h | 2 +- .../CrossOriginPropertyDescriptorMap.h | 2 +- .../LibWeb/HTML/ListOfAvailableImages.h | 2 +- Userland/Libraries/LibWeb/HTML/Origin.h | 2 +- .../LibWeb/HTML/Scripting/ModuleMap.h | 2 +- .../LibWeb/Layout/GridFormattingContext.cpp | 2 +- Userland/Libraries/LibWeb/Layout/TableGrid.h | 2 +- .../Libraries/LibWeb/Loader/LoadRequest.h | 2 +- .../LibWeb/Painting/TableBordersPainting.cpp | 2 +- Userland/Libraries/LibWeb/PixelUnits.h | 4 ++-- Userland/Libraries/LibWebView/CookieJar.h | 2 +- Userland/Services/DHCPClient/DHCPv4.h | 2 +- .../DeviceMapper/RegisteredDeviceNode.h | 2 +- .../Services/RequestServer/ConnectionCache.h | 2 +- Userland/Services/SpiceAgent/ChunkHeader.h | 2 +- Userland/Services/SpiceAgent/MessageHeader.h | 2 +- Userland/Services/Taskbar/WindowIdentifier.h | 2 +- Userland/Shell/Shell.h | 2 +- Userland/Utilities/du.cpp | 2 +- Userland/Utilities/sort.cpp | 2 +- Userland/Utilities/top.cpp | 2 +- 101 files changed, 154 insertions(+), 154 deletions(-) diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index e2fc73bbfe3..947f883d36e 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -341,7 +341,7 @@ private: } template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(ByteBuffer const& byte_buffer) { return Traits::hash(byte_buffer.span()); diff --git a/AK/DeprecatedFlyString.h b/AK/DeprecatedFlyString.h index 76d924da09f..b7b0ca03750 100644 --- a/AK/DeprecatedFlyString.h +++ b/AK/DeprecatedFlyString.h @@ -95,7 +95,7 @@ private: }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(DeprecatedFlyString const& s) { return s.hash(); } }; diff --git a/AK/DeprecatedString.h b/AK/DeprecatedString.h index ad939d0c21e..4813342bded 100644 --- a/AK/DeprecatedString.h +++ b/AK/DeprecatedString.h @@ -308,7 +308,7 @@ private: }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(DeprecatedString const& s) { return s.impl() ? s.impl()->hash() : 0; } }; diff --git a/AK/DisjointChunks.h b/AK/DisjointChunks.h index f95bdb52256..60ed379367e 100644 --- a/AK/DisjointChunks.h +++ b/AK/DisjointChunks.h @@ -449,7 +449,7 @@ private: }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static unsigned hash(DisjointSpans const& span) { unsigned hash = 0; diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 82f63dd3464..17b794e774e 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -326,7 +326,7 @@ struct Formatter> : Formatter { constexpr bool operator==(DN n, E e) { return n.value() == to_underlying(e); } template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static constexpr bool is_trivial() { return true; } static constexpr auto hash(DistinctNumeric const& d) { return Traits::hash(d.value()); } }; diff --git a/AK/Endian.h b/AK/Endian.h index e0c6a9afa27..936304818f5 100644 --- a/AK/Endian.h +++ b/AK/Endian.h @@ -121,22 +121,22 @@ requires(HasFormatter) struct Formatter> : Formatter { }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static constexpr bool is_trivially_serializable() { return Traits::is_trivially_serializable(); } }; template -struct Traits const> : public GenericTraits const> { +struct Traits const> : public DefaultTraits const> { static constexpr bool is_trivially_serializable() { return Traits::is_trivially_serializable(); } }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static constexpr bool is_trivially_serializable() { return Traits::is_trivially_serializable(); } }; template -struct Traits const> : public GenericTraits const> { +struct Traits const> : public DefaultTraits const> { static constexpr bool is_trivially_serializable() { return Traits::is_trivially_serializable(); } }; diff --git a/AK/FlyString.h b/AK/FlyString.h index 1647af82b5a..bc938159f61 100644 --- a/AK/FlyString.h +++ b/AK/FlyString.h @@ -86,7 +86,7 @@ private: }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(FlyString const&); }; diff --git a/AK/IPv4Address.h b/AK/IPv4Address.h index 2365b5c95d0..f927777508c 100644 --- a/AK/IPv4Address.h +++ b/AK/IPv4Address.h @@ -162,7 +162,7 @@ private: static_assert(sizeof(IPv4Address) == 4); template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(IPv4Address const& address) { return secure_sip_hash(static_cast(address.to_u32())); } }; diff --git a/AK/IPv6Address.h b/AK/IPv6Address.h index e9f36535094..2a3c9ea6f18 100644 --- a/AK/IPv6Address.h +++ b/AK/IPv6Address.h @@ -269,7 +269,7 @@ private: static_assert(sizeof(IPv6Address) == 16); template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { // 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()) }); } }; diff --git a/AK/MACAddress.h b/AK/MACAddress.h index 3e410f40859..cd90c83fe34 100644 --- a/AK/MACAddress.h +++ b/AK/MACAddress.h @@ -111,7 +111,7 @@ static_assert(sizeof(MACAddress) == 6u); namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(MACAddress const& address) { return string_hash((char const*)&address, sizeof(address)); } }; diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index 843faa4f20b..445ebba2f57 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -183,7 +183,7 @@ inline ErrorOr> try_make(Args&&... args) } template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = T*; using ConstPeekType = T const*; static unsigned hash(NonnullOwnPtr const& p) { return ptr_hash(p.ptr()); } diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index 049181ecdcf..09e0e69d436 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -285,7 +285,7 @@ inline NonnullRefPtr make_ref_counted(Args&&... args) } template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = T*; using ConstPeekType = T const*; static unsigned hash(NonnullRefPtr const& p) { return ptr_hash(p.ptr()); } diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index 2ccb0c3f9a6..98246375b35 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -193,7 +193,7 @@ inline OwnPtr adopt_own_if_nonnull(T* object) } template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = T*; using ConstPeekType = T const*; static unsigned hash(OwnPtr const& p) { return ptr_hash(p.ptr()); } diff --git a/AK/RefPtr.h b/AK/RefPtr.h index 0cc650bcd1a..58395b49767 100644 --- a/AK/RefPtr.h +++ b/AK/RefPtr.h @@ -293,7 +293,7 @@ struct Formatter> : Formatter { }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = T*; using ConstPeekType = T const*; static unsigned hash(RefPtr const& p) { return ptr_hash(p.ptr()); } diff --git a/AK/Span.h b/AK/Span.h index 52164532751..a39c3757a75 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -296,7 +296,7 @@ public: }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static unsigned hash(Span const& span) { unsigned hash = 0; diff --git a/AK/String.h b/AK/String.h index ab7ae9a2e8f..e84ab8abef4 100644 --- a/AK/String.h +++ b/AK/String.h @@ -257,7 +257,7 @@ private: }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(String const&); }; diff --git a/AK/StringView.h b/AK/StringView.h index 5db9b5673ff..94ac28c36a2 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -360,7 +360,7 @@ private: }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(StringView s) { return s.hash(); } }; diff --git a/AK/Traits.h b/AK/Traits.h index 515d779adc9..229c2d63ad7 100644 --- a/AK/Traits.h +++ b/AK/Traits.h @@ -16,7 +16,7 @@ namespace AK { template -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 -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { }; template -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { 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 : public GenericTraits { #ifndef KERNEL template -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { 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 : public GenericTraits { #endif template -requires(IsPointer && !Detail::IsPointerOfType) struct Traits : public GenericTraits { +requires(IsPointer && !Detail::IsPointerOfType) struct Traits : public DefaultTraits { static unsigned hash(T p) { return standard_sip_hash(bit_cast(p)); } static constexpr bool is_trivial() { return true; } }; template -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(T value) { return Traits>::hash(to_underlying(value)); } static constexpr bool is_trivial() { return Traits>::is_trivial(); } static constexpr bool is_trivially_serializable() { return Traits>::is_trivially_serializable(); } }; template -requires(Detail::IsPointerOfType) struct Traits : public GenericTraits { +requires(Detail::IsPointerOfType) struct Traits : public DefaultTraits { 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) struct Traits : public GenericTrai } #if USING_AK_GLOBALLY -using AK::GenericTraits; +using AK::DefaultTraits; using AK::Traits; #endif diff --git a/AK/UFixedBigInt.h b/AK/UFixedBigInt.h index 3764da9c6b0..e687a19eceb 100644 --- a/AK/UFixedBigInt.h +++ b/AK/UFixedBigInt.h @@ -581,7 +581,7 @@ private: }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static constexpr bool is_trivially_serializable() { return true; } static constexpr bool is_trivial() { return true; } }; diff --git a/AK/URL.h b/AK/URL.h index ad8bf5157a5..951297a738c 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -197,7 +197,7 @@ struct Formatter : Formatter { }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(URL const& url) { return url.to_deprecated_string().hash(); } }; diff --git a/Kernel/FileSystem/FileSystem.h b/Kernel/FileSystem/FileSystem.h index 0bb72530e87..b7e6ae7ba2a 100644 --- a/Kernel/FileSystem/FileSystem.h +++ b/Kernel/FileSystem/FileSystem.h @@ -88,7 +88,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Kernel::InodeIdentifier const& inode) { return pair_int_hash(inode.fsid().value(), inode.index().value()); } }; diff --git a/Kernel/Library/KString.h b/Kernel/Library/KString.h index 80928ef8b5b..5e299bb3b15 100644 --- a/Kernel/Library/KString.h +++ b/Kernel/Library/KString.h @@ -86,7 +86,7 @@ struct Formatter> : Formatter { }; template<> -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = Kernel::KString*; using ConstPeekType = Kernel::KString const*; static unsigned hash(NonnullOwnPtr const& p) { return string_hash(p->characters(), p->length()); } @@ -95,7 +95,7 @@ struct Traits> : public GenericTraits -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = Kernel::KString*; using ConstPeekType = Kernel::KString const*; static unsigned hash(OwnPtr const& p) diff --git a/Kernel/Library/LockRefPtr.h b/Kernel/Library/LockRefPtr.h index 6486b0fa7cb..da8b29e40ff 100644 --- a/Kernel/Library/LockRefPtr.h +++ b/Kernel/Library/LockRefPtr.h @@ -460,7 +460,7 @@ struct Formatter> : Formatter { }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = T*; using ConstPeekType = T const*; static unsigned hash(LockRefPtr const& p) { return ptr_hash(p.ptr()); } diff --git a/Kernel/Library/NonnullLockRefPtr.h b/Kernel/Library/NonnullLockRefPtr.h index 3b915692fa4..d6d1442b661 100644 --- a/Kernel/Library/NonnullLockRefPtr.h +++ b/Kernel/Library/NonnullLockRefPtr.h @@ -329,7 +329,7 @@ requires(IsConvertible) } template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { using PeekType = T*; using ConstPeekType = T const*; static unsigned hash(NonnullLockRefPtr const& p) { return ptr_hash(p.ptr()); } diff --git a/Kernel/Net/IPv4SocketTuple.h b/Kernel/Net/IPv4SocketTuple.h index 774e1132a93..f9d5ea4638b 100644 --- a/Kernel/Net/IPv4SocketTuple.h +++ b/Kernel/Net/IPv4SocketTuple.h @@ -56,7 +56,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Kernel::IPv4SocketTuple const& tuple) { auto h1 = pair_int_hash(tuple.local_address().to_u32(), tuple.local_port()); diff --git a/Kernel/Tasks/Process.h b/Kernel/Tasks/Process.h index 4915fb6649b..3218202bda8 100644 --- a/Kernel/Tasks/Process.h +++ b/Kernel/Tasks/Process.h @@ -1098,7 +1098,7 @@ struct AK::Formatter : AK::Formatter { namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { 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; } }; diff --git a/Ladybird/AppKit/UI/Inspector.mm b/Ladybird/AppKit/UI/Inspector.mm index b0989dbdb12..ea84b18b141 100644 --- a/Ladybird/AppKit/UI/Inspector.mm +++ b/Ladybird/AppKit/UI/Inspector.mm @@ -28,7 +28,7 @@ static NSString* const CSS_PROPERTY_COLUMN = @"Property"; static NSString* const CSS_VALUE_COLUMN = @"Value"; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(NSDictionary* dictionary) { return [dictionary hash]; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp index 8481023696d..44789917ff1 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp @@ -118,7 +118,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(CalendarPattern const& c) { return c.hash(); } }; @@ -185,7 +185,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(CalendarRangePattern const& c) { return c.hash(); } }; @@ -226,7 +226,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(CalendarFormat const& c) { return c.hash(); } }; @@ -265,7 +265,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(CalendarSymbols const& c) { return c.hash(); } }; @@ -329,7 +329,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Calendar const& c) { return c.hash(); } }; @@ -381,7 +381,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(TimeZoneNames const& t) { return t.hash(); } }; @@ -432,7 +432,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(TimeZoneFormat const& t) { return t.hash(); } }; @@ -470,7 +470,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(DayPeriod const& d) { return d.hash(); } }; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp index 4937170dc28..383d068b79a 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateLocaleData.cpp @@ -61,7 +61,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(DisplayPattern const& p) { return p.hash(); } }; @@ -110,7 +110,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(ListPatterns const& p) { return p.hash(); } }; @@ -139,7 +139,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(TextLayout const& t) { return t.hash(); } }; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp index 4c515eedc3f..1059270ad93 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateNumberFormatData.cpp @@ -90,7 +90,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(NumberFormat const& f) { return f.hash(); } }; @@ -167,7 +167,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(NumberSystem const& s) { return s.hash(); } }; @@ -209,7 +209,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Unit const& u) { return u.hash(); } }; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp index a57bb06feec..f68e69efc76 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp @@ -61,7 +61,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(RelativeTimeFormat const& format) { return format.hash(); } }; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h index 5e16263cd47..d251e1de8a3 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h @@ -33,7 +33,7 @@ template concept IntegralOrEnum = Integral || Enum; template -struct AK::Traits> : public GenericTraits> { +struct AK::Traits> : public DefaultTraits> { static unsigned hash(Vector const& list) { auto hash = int_hash(static_cast(list.size())); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp index 2cbec5abdf5..95bf12ab82c 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp @@ -230,7 +230,7 @@ bool property_has_quirk(PropertyID, Quirk); namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::CSS::PropertyID property_id) { return int_hash((unsigned)property_id); } }; } // namespace AK diff --git a/Tests/AK/TestHashTable.cpp b/Tests/AK/TestHashTable.cpp index a6e18845eda..d1ca5d1788c 100644 --- a/Tests/AK/TestHashTable.cpp +++ b/Tests/AK/TestHashTable.cpp @@ -155,7 +155,7 @@ TEST_CASE(many_strings) TEST_CASE(many_collisions) { - struct StringCollisionTraits : public GenericTraits { + struct StringCollisionTraits : public DefaultTraits { static unsigned hash(DeprecatedString const&) { return 0; } }; @@ -176,7 +176,7 @@ TEST_CASE(many_collisions) TEST_CASE(space_reuse) { - struct StringCollisionTraits : public GenericTraits { + struct StringCollisionTraits : public DefaultTraits { static unsigned hash(DeprecatedString const&) { return 0; } }; diff --git a/Userland/Applications/Maps/MapWidget.h b/Userland/Applications/Maps/MapWidget.h index 886f3938f15..e2c9e3cb927 100644 --- a/Userland/Applications/Maps/MapWidget.h +++ b/Userland/Applications/Maps/MapWidget.h @@ -200,6 +200,6 @@ private: } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Maps::MapWidget::TileKey const& t) { return t.hash(); } }; diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.h b/Userland/Applications/Spreadsheet/Spreadsheet.h index f157f7d4ad6..28e4bad61af 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.h +++ b/Userland/Applications/Spreadsheet/Spreadsheet.h @@ -179,7 +179,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivial() { return false; } static unsigned hash(Spreadsheet::Position const& p) { diff --git a/Userland/DevTools/UserspaceEmulator/Range.h b/Userland/DevTools/UserspaceEmulator/Range.h index 98b489552f3..7bde305e24d 100644 --- a/Userland/DevTools/UserspaceEmulator/Range.h +++ b/Userland/DevTools/UserspaceEmulator/Range.h @@ -69,7 +69,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivial() { return true; } }; } diff --git a/Userland/Games/ColorLines/Marble.h b/Userland/Games/ColorLines/Marble.h index 5ec2238ad0a..f72951a3f8c 100644 --- a/Userland/Games/ColorLines/Marble.h +++ b/Userland/Games/ColorLines/Marble.h @@ -37,7 +37,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Marble const& marble) { return Traits::hash(marble.position()); diff --git a/Userland/Libraries/LibAccelGfx/Painter.h b/Userland/Libraries/LibAccelGfx/Painter.h index 1869daec429..686e9c538d7 100644 --- a/Userland/Libraries/LibAccelGfx/Painter.h +++ b/Userland/Libraries/LibAccelGfx/Painter.h @@ -97,7 +97,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(AccelGfx::Painter::GlyphsTextureKey const& key) { return pair_int_hash(ptr_hash(key.font), key.code_point); diff --git a/Userland/Libraries/LibArchive/Tar.h b/Userland/Libraries/LibArchive/Tar.h index 86ad43059f4..2186c6be2f9 100644 --- a/Userland/Libraries/LibArchive/Tar.h +++ b/Userland/Libraries/LibArchive/Tar.h @@ -157,6 +157,6 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibChess/Chess.h b/Userland/Libraries/LibChess/Chess.h index acff4ee9d45..6037cb4200c 100644 --- a/Userland/Libraries/LibChess/Chess.h +++ b/Userland/Libraries/LibChess/Chess.h @@ -293,7 +293,7 @@ void Board::generate_moves(Callback callback, Color color) const } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Chess::Piece const& piece) { return pair_int_hash(static_cast(piece.color), static_cast(piece.type)); @@ -301,7 +301,7 @@ struct AK::Traits : public GenericTraits { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Chess::Board const& chess) { unsigned hash = 0; diff --git a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h index e635afc2859..43f24cb4f20 100644 --- a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h +++ b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h @@ -189,7 +189,7 @@ void CppComprehensionEngine::for_each_included_document_recursive(DocumentData c namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(CodeComprehension::Cpp::CppComprehensionEngine::SymbolName const& key) { unsigned hash = 0; diff --git a/Userland/Libraries/LibCompress/Lzma.h b/Userland/Libraries/LibCompress/Lzma.h index 18f6307f21b..066c97612c9 100644 --- a/Userland/Libraries/LibCompress/Lzma.h +++ b/Userland/Libraries/LibCompress/Lzma.h @@ -271,6 +271,6 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibCompress/Xz.h b/Userland/Libraries/LibCompress/Xz.h index aa9e69fd987..997631ca2a6 100644 --- a/Userland/Libraries/LibCompress/Xz.h +++ b/Userland/Libraries/LibCompress/Xz.h @@ -162,16 +162,16 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibCompress/Zlib.h b/Userland/Libraries/LibCompress/Zlib.h index 6a3e0813f3c..478ead7f24e 100644 --- a/Userland/Libraries/LibCompress/Zlib.h +++ b/Userland/Libraries/LibCompress/Zlib.h @@ -88,6 +88,6 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibCore/SOCKSProxyClient.cpp b/Userland/Libraries/LibCore/SOCKSProxyClient.cpp index 88a001c8978..199def7297c 100644 --- a/Userland/Libraries/LibCore/SOCKSProxyClient.cpp +++ b/Userland/Libraries/LibCore/SOCKSProxyClient.cpp @@ -40,7 +40,7 @@ struct [[gnu::packed]] Socks5VersionIdentifierAndMethodSelectionMessage { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; @@ -50,7 +50,7 @@ struct [[gnu::packed]] Socks5InitialResponse { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; @@ -61,7 +61,7 @@ struct [[gnu::packed]] Socks5ConnectRequestHeader { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; @@ -70,7 +70,7 @@ struct [[gnu::packed]] Socks5ConnectRequestTrailer { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; @@ -81,7 +81,7 @@ struct [[gnu::packed]] Socks5ConnectResponseHeader { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; @@ -95,7 +95,7 @@ struct [[gnu::packed]] Socks5UsernamePasswordResponse { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibCore/SocketAddress.h b/Userland/Libraries/LibCore/SocketAddress.h index 28dc6833df6..48f7cb6426d 100644 --- a/Userland/Libraries/LibCore/SocketAddress.h +++ b/Userland/Libraries/LibCore/SocketAddress.h @@ -105,7 +105,7 @@ struct AK::Formatter : Formatter { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Core::SocketAddress const& socket_address) { return pair_int_hash(Traits::hash(socket_address.ipv4_address()), Traits::hash(socket_address.port())); diff --git a/Userland/Libraries/LibDNS/Answer.h b/Userland/Libraries/LibDNS/Answer.h index 9a4c073e958..73263315dbd 100644 --- a/Userland/Libraries/LibDNS/Answer.h +++ b/Userland/Libraries/LibDNS/Answer.h @@ -65,7 +65,7 @@ private: } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static constexpr bool is_trivial() { return false; } static unsigned hash(DNS::Answer a) { return a.hash(); } }; diff --git a/Userland/Libraries/LibDNS/PacketHeader.h b/Userland/Libraries/LibDNS/PacketHeader.h index 300286f0ed4..fe4d46677d3 100644 --- a/Userland/Libraries/LibDNS/PacketHeader.h +++ b/Userland/Libraries/LibDNS/PacketHeader.h @@ -99,6 +99,6 @@ static_assert(sizeof(PacketHeader) == 12); } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h index a9473cb556d..6750609a290 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -70,7 +70,7 @@ struct Formatter : Formatter { }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(const GUI::ModelIndex& index) { return pair_int_hash(pair_int_hash(index.row(), index.column()), reinterpret_cast(index.internal_data())); diff --git a/Userland/Libraries/LibGUI/PersistentModelIndex.h b/Userland/Libraries/LibGUI/PersistentModelIndex.h index 0690ebd0de4..a2d7666aa2b 100644 --- a/Userland/Libraries/LibGUI/PersistentModelIndex.h +++ b/Userland/Libraries/LibGUI/PersistentModelIndex.h @@ -81,7 +81,7 @@ struct Formatter : Formatter { }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(const GUI::PersistentModelIndex& index) { if (index.has_valid_handle()) diff --git a/Userland/Libraries/LibGUI/Shortcut.h b/Userland/Libraries/LibGUI/Shortcut.h index 835d626bfcb..fa8d199dcfd 100644 --- a/Userland/Libraries/LibGUI/Shortcut.h +++ b/Userland/Libraries/LibGUI/Shortcut.h @@ -80,7 +80,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(const GUI::Shortcut& shortcut) { auto base_hash = pair_int_hash(shortcut.modifiers(), (u32)shortcut.type()); diff --git a/Userland/Libraries/LibGfx/Font/BitmapFont.cpp b/Userland/Libraries/LibGfx/Font/BitmapFont.cpp index db950b5271c..a12e423e33f 100644 --- a/Userland/Libraries/LibGfx/Font/BitmapFont.cpp +++ b/Userland/Libraries/LibGfx/Font/BitmapFont.cpp @@ -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 doesn't apply to Traits. Once that's fixed, remove the const here. template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/Font/OpenType/DataTypes.h b/Userland/Libraries/LibGfx/Font/OpenType/DataTypes.h index d3c687bb315..db3fe2e64b9 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/DataTypes.h +++ b/Userland/Libraries/LibGfx/Font/OpenType/DataTypes.h @@ -55,19 +55,19 @@ static_assert(AssertSize()); namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; } diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp index 6194b7547b0..53ce004bc55 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp +++ b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp @@ -37,7 +37,7 @@ static_assert(AssertSize()); } template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Tables.h b/Userland/Libraries/LibGfx/Font/OpenType/Tables.h index 0f5f619f66f..93fc02742f0 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Tables.h +++ b/Userland/Libraries/LibGfx/Font/OpenType/Tables.h @@ -48,13 +48,13 @@ static_assert(AssertSize()); } template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; @@ -788,47 +788,47 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; } diff --git a/Userland/Libraries/LibGfx/Font/ScaledFont.h b/Userland/Libraries/LibGfx/Font/ScaledFont.h index 1ae93d69bfe..fb3a00f7457 100644 --- a/Userland/Libraries/LibGfx/Font/ScaledFont.h +++ b/Userland/Libraries/LibGfx/Font/ScaledFont.h @@ -97,7 +97,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Gfx::GlyphIndexWithSubpixelOffset const& index) { return pair_int_hash(index.glyph_id, (index.subpixel_offset.x << 8) | index.subpixel_offset.y); diff --git a/Userland/Libraries/LibGfx/Font/WOFF/Font.cpp b/Userland/Libraries/LibGfx/Font/WOFF/Font.cpp index 86b7409096d..defe0136991 100644 --- a/Userland/Libraries/LibGfx/Font/WOFF/Font.cpp +++ b/Userland/Libraries/LibGfx/Font/WOFF/Font.cpp @@ -47,13 +47,13 @@ static_assert(AssertSize()); } template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/Font/WOFF2/Font.cpp b/Userland/Libraries/LibGfx/Font/WOFF2/Font.cpp index 392f89afe94..b3533e52a16 100644 --- a/Userland/Libraries/LibGfx/Font/WOFF2/Font.cpp +++ b/Userland/Libraries/LibGfx/Font/WOFF2/Font.cpp @@ -42,7 +42,7 @@ static_assert(AssertSize()); } template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; @@ -496,7 +496,7 @@ static_assert(AssertSize()); } template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/ICC/DistinctFourCC.h b/Userland/Libraries/LibGfx/ICC/DistinctFourCC.h index 1d037b57111..7b23f289339 100644 --- a/Userland/Libraries/LibGfx/ICC/DistinctFourCC.h +++ b/Userland/Libraries/LibGfx/ICC/DistinctFourCC.h @@ -65,7 +65,7 @@ struct AK::Formatter> : StandardFormatter { }; template -struct AK::Traits> : public GenericTraits> { +struct AK::Traits> : public DefaultTraits> { static unsigned hash(Gfx::ICC::DistinctFourCC const& key) { return int_hash(key.value); diff --git a/Userland/Libraries/LibGfx/ImageFormats/DDSLoader.h b/Userland/Libraries/LibGfx/ImageFormats/DDSLoader.h index 69b46476b6d..3bc77f1e418 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/DDSLoader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/DDSLoader.h @@ -254,11 +254,11 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/ImageFormats/ICOLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/ICOLoader.cpp index e9180e2432f..a56f57907d5 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/ICOLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/ICOLoader.cpp @@ -38,13 +38,13 @@ static_assert(AssertSize()); }; template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; template<> -class AK::Traits : public GenericTraits { +class AK::Traits : public DefaultTraits { public: static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h b/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h index bb9a034d2fc..c1908ebdbf3 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h @@ -59,6 +59,6 @@ private: } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/ImageFormats/TGALoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/TGALoader.cpp index 32746f54a67..98b53655e77 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TGALoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/TGALoader.cpp @@ -44,7 +44,7 @@ static_assert(sizeof(TGAHeader) == 18); } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h index 51062877f4b..77ba60328e8 100644 --- a/Userland/Libraries/LibGfx/Point.h +++ b/Userland/Libraries/LibGfx/Point.h @@ -313,7 +313,7 @@ ErrorOr decode(Decoder&); } template -struct AK::Traits> : public AK::GenericTraits> { +struct AK::Traits> : public AK::DefaultTraits> { static constexpr bool is_trivial() { return false; } static unsigned hash(Gfx::Point const& point) { diff --git a/Userland/Libraries/LibJS/Heap/GCPtr.h b/Userland/Libraries/LibJS/Heap/GCPtr.h index 29e05ec2be0..a9c853b6a2b 100644 --- a/Userland/Libraries/LibJS/Heap/GCPtr.h +++ b/Userland/Libraries/LibJS/Heap/GCPtr.h @@ -215,7 +215,7 @@ inline bool operator==(NonnullGCPtr const& a, GCPtr const& b) namespace AK { template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static unsigned hash(JS::GCPtr const& value) { return Traits::hash(value.ptr()); @@ -223,7 +223,7 @@ struct Traits> : public GenericTraits> { }; template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static unsigned hash(JS::NonnullGCPtr const& value) { return Traits::hash(value.ptr()); diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h index 36be3bf0ae9..e7dedd7ce06 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.h +++ b/Userland/Libraries/LibJS/Heap/Handle.h @@ -195,12 +195,12 @@ inline Handle make_handle(Value value, SourceLocation location = SourceLo namespace AK { template -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static unsigned hash(JS::Handle const& handle) { return Traits::hash(handle); } }; template<> -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static unsigned hash(JS::Handle const& handle) { return Traits::hash(handle.value()); } }; diff --git a/Userland/Libraries/LibJS/Runtime/PropertyKey.h b/Userland/Libraries/LibJS/Runtime/PropertyKey.h index 9230fed8496..0d0203a908d 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyKey.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyKey.h @@ -195,7 +195,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(JS::PropertyKey const& name) { VERIFY(name.is_valid()); diff --git a/Userland/Libraries/LibJS/Runtime/Shape.h b/Userland/Libraries/LibJS/Runtime/Shape.h index 45a0a4cf181..be591f35637 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.h +++ b/Userland/Libraries/LibJS/Runtime/Shape.h @@ -119,7 +119,7 @@ private: } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(const JS::TransitionKey& key) { return pair_int_hash(key.attributes.bits(), Traits::hash(key.property_key)); diff --git a/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h b/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h index bb835277537..9d5037d8770 100644 --- a/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h +++ b/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h @@ -154,7 +154,7 @@ private: } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(JS::StringOrSymbol const& key) { return key.hash(); diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h index 94f3957a4b6..8882799847f 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.h +++ b/Userland/Libraries/LibJS/Runtime/Value.h @@ -706,7 +706,7 @@ struct Formatter : Formatter { }; template<> -struct Traits : GenericTraits { +struct Traits : DefaultTraits { static unsigned hash(JS::Value value) { return Traits::hash(value.encoded()); } }; diff --git a/Userland/Libraries/LibLine/KeyCallbackMachine.h b/Userland/Libraries/LibLine/KeyCallbackMachine.h index bac18789678..a18814b0197 100644 --- a/Userland/Libraries/LibLine/KeyCallbackMachine.h +++ b/Userland/Libraries/LibLine/KeyCallbackMachine.h @@ -66,13 +66,13 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivial() { return true; } static unsigned hash(Line::Key k) { return pair_int_hash(k.key, k.modifiers); } }; template<> -struct Traits> : public GenericTraits> { +struct Traits> : public DefaultTraits> { static constexpr bool is_trivial() { return false; } static unsigned hash(Vector const& ks) { diff --git a/Userland/Libraries/LibManual/Node.h b/Userland/Libraries/LibManual/Node.h index c96fafbddfe..947d8e8ff5a 100644 --- a/Userland/Libraries/LibManual/Node.h +++ b/Userland/Libraries/LibManual/Node.h @@ -54,7 +54,7 @@ public: namespace AK { template -requires(IsBaseOf) struct Traits : public GenericTraits { +requires(IsBaseOf) struct Traits : public DefaultTraits { static unsigned hash(T p) { return Traits::hash(p.path()); } }; diff --git a/Userland/Libraries/LibPDF/Fonts/Type1Font.h b/Userland/Libraries/LibPDF/Fonts/Type1Font.h index 7faa3cf8b96..dedd2b461ef 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type1Font.h +++ b/Userland/Libraries/LibPDF/Fonts/Type1Font.h @@ -41,7 +41,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { 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(index.width))); diff --git a/Userland/Libraries/LibPDF/Renderer.h b/Userland/Libraries/LibPDF/Renderer.h index 201802af0cf..685e9194fa3 100644 --- a/Userland/Libraries/LibPDF/Renderer.h +++ b/Userland/Libraries/LibPDF/Renderer.h @@ -172,7 +172,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(PDF::Renderer::FontCacheKey const& key) { return pair_int_hash(key.font_dictionary_key.hash(), int_hash(bit_cast(key.font_size))); diff --git a/Userland/Libraries/LibSyntax/Highlighter.h b/Userland/Libraries/LibSyntax/Highlighter.h index b9ac566679b..1fa86821035 100644 --- a/Userland/Libraries/LibSyntax/Highlighter.h +++ b/Userland/Libraries/LibSyntax/Highlighter.h @@ -149,7 +149,7 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static unsigned hash(Syntax::Highlighter::MatchingTokenPair const& pair) { return pair_int_hash(u64_hash(pair.open), u64_hash(pair.close)); diff --git a/Userland/Libraries/LibVideo/Track.h b/Userland/Libraries/LibVideo/Track.h index d16ae1c024f..9e7b0b0ae37 100644 --- a/Userland/Libraries/LibVideo/Track.h +++ b/Userland/Libraries/LibVideo/Track.h @@ -77,6 +77,6 @@ private: } template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Video::Track const& t) { return t.hash(); } }; diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h index f6ac5f93ad1..18dbe58efd5 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h @@ -670,7 +670,7 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { 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; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 4856b1bbbec..1900511233d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -69,7 +69,7 @@ namespace AK { // traits for FontFaceKey template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::CSS::FontFaceKey const& key) { return pair_int_hash(key.family_name.hash(), pair_int_hash(key.weight, key.slope)); } }; diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.h b/Userland/Libraries/LibWeb/CSS/StyleComputer.h index 5a0f3ef225c..2145dc006db 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.h @@ -250,7 +250,7 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { 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) { diff --git a/Userland/Libraries/LibWeb/FontCache.h b/Userland/Libraries/LibWeb/FontCache.h index fedb577193a..536436c9c82 100644 --- a/Userland/Libraries/LibWeb/FontCache.h +++ b/Userland/Libraries/LibWeb/FontCache.h @@ -45,7 +45,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::FontSelector const& key) { return pair_int_hash(pair_int_hash(key.family.hash(), key.weight), key.point_size); } }; } diff --git a/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h b/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h index acd8d8b34f8..e08c05072a4 100644 --- a/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h +++ b/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h @@ -34,7 +34,7 @@ using CrossOriginPropertyDescriptorMap = HashMap -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::HTML::CrossOriginKey const& key) { return pair_int_hash( diff --git a/Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.h b/Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.h index 3591a395b75..2d555ae95c0 100644 --- a/Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.h +++ b/Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.h @@ -57,7 +57,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::HTML::ListOfAvailableImages::Key const& key) { return key.hash(); diff --git a/Userland/Libraries/LibWeb/HTML/Origin.h b/Userland/Libraries/LibWeb/HTML/Origin.h index e7b252eddb2..44bcddac02e 100644 --- a/Userland/Libraries/LibWeb/HTML/Origin.h +++ b/Userland/Libraries/LibWeb/HTML/Origin.h @@ -122,7 +122,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::HTML::Origin const& origin) { auto hash_without_host = pair_int_hash(origin.scheme().hash(), origin.port()); diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h b/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h index 032f8e3f394..366c66d8300 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h @@ -78,7 +78,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::HTML::ModuleLocationTuple const& tuple) { return pair_int_hash(tuple.url().to_deprecated_string().hash(), tuple.type().hash()); diff --git a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp index e18edbd4276..49e8e8d055c 100644 --- a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp @@ -2470,7 +2470,7 @@ CSSPixels GridFormattingContext::calculate_minimum_contribution(GridItem const& namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::Layout::GridPosition const& key) { return pair_int_hash(key.row, key.column); } }; } diff --git a/Userland/Libraries/LibWeb/Layout/TableGrid.h b/Userland/Libraries/LibWeb/Layout/TableGrid.h index 5445b6261f7..231a300edb7 100644 --- a/Userland/Libraries/LibWeb/Layout/TableGrid.h +++ b/Userland/Libraries/LibWeb/Layout/TableGrid.h @@ -89,7 +89,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::Layout::TableGrid::GridPosition const& key) { return pair_int_hash(key.x, key.y); diff --git a/Userland/Libraries/LibWeb/Loader/LoadRequest.h b/Userland/Libraries/LibWeb/Loader/LoadRequest.h index dc49d6502ba..5506de76dc5 100644 --- a/Userland/Libraries/LibWeb/Loader/LoadRequest.h +++ b/Userland/Libraries/LibWeb/Loader/LoadRequest.h @@ -88,7 +88,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::LoadRequest const& request) { return request.hash(); } }; diff --git a/Userland/Libraries/LibWeb/Painting/TableBordersPainting.cpp b/Userland/Libraries/LibWeb/Painting/TableBordersPainting.cpp index b03c79203ec..18a2c6e1149 100644 --- a/Userland/Libraries/LibWeb/Painting/TableBordersPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/TableBordersPainting.cpp @@ -23,7 +23,7 @@ struct CellCoordinates { namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(CellCoordinates const& key) { return pair_int_hash(key.row_index, key.column_index); } }; } diff --git a/Userland/Libraries/LibWeb/PixelUnits.h b/Userland/Libraries/LibWeb/PixelUnits.h index 2ccdeacd441..e39172415cc 100644 --- a/Userland/Libraries/LibWeb/PixelUnits.h +++ b/Userland/Libraries/LibWeb/PixelUnits.h @@ -462,7 +462,7 @@ template<> namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::CSSPixels const& key) { return Traits::hash(key.raw_value()); @@ -475,7 +475,7 @@ struct Traits : public GenericTraits { }; template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(Web::DevicePixels const& key) { return Traits::hash(key.value()); diff --git a/Userland/Libraries/LibWebView/CookieJar.h b/Userland/Libraries/LibWebView/CookieJar.h index 427901d94e0..18ac7ac402e 100644 --- a/Userland/Libraries/LibWebView/CookieJar.h +++ b/Userland/Libraries/LibWebView/CookieJar.h @@ -91,7 +91,7 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static unsigned hash(WebView::CookieStorageKey const& key) { unsigned hash = 0; diff --git a/Userland/Services/DHCPClient/DHCPv4.h b/Userland/Services/DHCPClient/DHCPv4.h index 87b6d28abd7..fbc9beee797 100644 --- a/Userland/Services/DHCPClient/DHCPv4.h +++ b/Userland/Services/DHCPClient/DHCPv4.h @@ -106,7 +106,7 @@ enum class DHCPMessageType : u8 { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static constexpr bool is_trivial() { return true; } static unsigned hash(DHCPOption u) { return int_hash((u8)u); } }; diff --git a/Userland/Services/DeviceMapper/RegisteredDeviceNode.h b/Userland/Services/DeviceMapper/RegisteredDeviceNode.h index c04eab53fff..ff0ef2a8611 100644 --- a/Userland/Services/DeviceMapper/RegisteredDeviceNode.h +++ b/Userland/Services/DeviceMapper/RegisteredDeviceNode.h @@ -34,7 +34,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(DeviceMapper::RegisteredDeviceNode const& node) { return int_hash(node.minor_number().value()); diff --git a/Userland/Services/RequestServer/ConnectionCache.h b/Userland/Services/RequestServer/ConnectionCache.h index ec42a2bf972..2cbd3546067 100644 --- a/Userland/Services/RequestServer/ConnectionCache.h +++ b/Userland/Services/RequestServer/ConnectionCache.h @@ -111,7 +111,7 @@ struct ConnectionKey { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { 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)); diff --git a/Userland/Services/SpiceAgent/ChunkHeader.h b/Userland/Services/SpiceAgent/ChunkHeader.h index bcf9c21e679..041b1218b7e 100644 --- a/Userland/Services/SpiceAgent/ChunkHeader.h +++ b/Userland/Services/SpiceAgent/ChunkHeader.h @@ -39,6 +39,6 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Services/SpiceAgent/MessageHeader.h b/Userland/Services/SpiceAgent/MessageHeader.h index 41edec8f1a8..7d1806851cc 100644 --- a/Userland/Services/SpiceAgent/MessageHeader.h +++ b/Userland/Services/SpiceAgent/MessageHeader.h @@ -48,7 +48,7 @@ private: } template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public AK::DefaultTraits { static constexpr bool is_trivially_serializable() { return true; } }; diff --git a/Userland/Services/Taskbar/WindowIdentifier.h b/Userland/Services/Taskbar/WindowIdentifier.h index 98a52122402..b16e9d36f1d 100644 --- a/Userland/Services/Taskbar/WindowIdentifier.h +++ b/Userland/Services/Taskbar/WindowIdentifier.h @@ -37,7 +37,7 @@ private: namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(WindowIdentifier const& w) { return pair_int_hash(w.client_id(), w.window_id()); } }; } diff --git a/Userland/Shell/Shell.h b/Userland/Shell/Shell.h index dee13616c85..98451ffac32 100644 --- a/Userland/Shell/Shell.h +++ b/Userland/Shell/Shell.h @@ -594,7 +594,7 @@ inline size_t find_offset_into_node(StringView unescaped_text, size_t escaped_of namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static constexpr bool is_trivial() { return false; } static bool equals(Shell::Shell::RunnablePath const& self, Shell::Shell::RunnablePath const& other) diff --git a/Userland/Utilities/du.cpp b/Userland/Utilities/du.cpp index 38d2ddf14b9..6415a3d80aa 100644 --- a/Userland/Utilities/du.cpp +++ b/Userland/Utilities/du.cpp @@ -43,7 +43,7 @@ struct VisitedFile { }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(VisitedFile const& visited_file) { return pair_int_hash(u64_hash(visited_file.device), u64_hash(visited_file.inode)); diff --git a/Userland/Utilities/sort.cpp b/Userland/Utilities/sort.cpp index 3f058c06c0f..1d97118302d 100644 --- a/Userland/Utilities/sort.cpp +++ b/Userland/Utilities/sort.cpp @@ -41,7 +41,7 @@ private: }; template<> -struct AK::Traits : public GenericTraits { +struct AK::Traits : public DefaultTraits { static unsigned hash(Line l) { if (l.numeric) diff --git a/Userland/Utilities/top.cpp b/Userland/Utilities/top.cpp index ef09d123f64..19b54320f1c 100644 --- a/Userland/Utilities/top.cpp +++ b/Userland/Utilities/top.cpp @@ -78,7 +78,7 @@ struct PidAndTid { namespace AK { template<> -struct Traits : public GenericTraits { +struct Traits : public DefaultTraits { static unsigned hash(PidAndTid const& value) { return pair_int_hash(value.pid, value.tid); } }; }