From a03d42b098e3bd8fb1149231b449996ecad3047c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 6 Jan 2023 15:14:59 -0500 Subject: [PATCH] LibCrypto: Use default Crypto::Hash::Digest comparison operators They do the same thing we previously laboriously did manually. No behavior change. --- Userland/Libraries/LibCrypto/Hash/HashFunction.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibCrypto/Hash/HashFunction.h b/Userland/Libraries/LibCrypto/Hash/HashFunction.h index 2e91f6c44e..a4026bb151 100644 --- a/Userland/Libraries/LibCrypto/Hash/HashFunction.h +++ b/Userland/Libraries/LibCrypto/Hash/HashFunction.h @@ -24,8 +24,8 @@ struct Digest { [[nodiscard]] ALWAYS_INLINE ReadonlyBytes bytes() const { return { immutable_data(), data_length() }; } - [[nodiscard]] bool operator==(Digest const& other) const { return memcmp(data, other.data, sizeof(data)) == 0; } - [[nodiscard]] bool operator!=(Digest const& other) const { return !(*this == other); } + [[nodiscard]] bool operator==(Digest const& other) const = default; + [[nodiscard]] bool operator!=(Digest const& other) const = default; }; template>