From 4296425bd8f2212e70167118e5a76c4922565080 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Fri, 21 Oct 2022 15:53:20 +0200 Subject: [PATCH] Everywhere: Remove redundant inequality comparison operators C++20 can automatically synthesize `operator!=` from `operator==`, so there is no point in writing such functions by hand if all they do is call through to `operator==`. This fixes a compile error with compilers that implement P2468 (Clang 16 currently). This paper restores the C++17 behavior that if both `T::operator==(U)` and `T::operator!=(U)` exist, `U == T` won't be rewritten in reverse to call `T::operator==(U)`. Removing `!=` operators makes the rewriting possible again. See https://reviews.llvm.org/D134529#3853062 --- AK/ByteBuffer.h | 2 -- AK/Complex.h | 6 ----- AK/DistinctNumeric.h | 4 --- AK/FlyString.h | 4 --- AK/IntrusiveList.h | 3 --- AK/JsonPath.h | 4 --- AK/NonnullRefPtr.h | 2 -- AK/RefPtr.h | 9 ------- AK/String.h | 4 --- AK/StringUtils.h | 4 --- AK/StringView.h | 5 ---- AK/Time.h | 1 - AK/UUID.cpp | 9 ------- AK/UUID.h | 7 +----- AK/Utf16View.h | 5 ---- AK/Utf32View.h | 4 --- Userland/Applications/Spreadsheet/Position.h | 5 ---- Userland/Libraries/LibDebug/DebugInfo.h | 1 - .../LibDeviceTree/FlattenedDeviceTree.h | 1 - Userland/Libraries/LibGUI/ModelIndex.h | 5 ---- Userland/Libraries/LibGfx/Color.h | 5 ---- Userland/Libraries/LibGfx/Point.h | 6 ----- Userland/Libraries/LibGfx/Rect.h | 6 ----- Userland/Libraries/LibGfx/Size.h | 6 ----- .../LibJS/Runtime/PropertyAttributes.h | 1 - .../Libraries/LibLine/KeyCallbackMachine.h | 5 ---- Userland/Libraries/LibRegex/RegexMatch.h | 25 ------------------- Userland/Libraries/LibSQL/HashIndex.h | 2 -- Userland/Libraries/LibVT/Attribute.h | 4 --- Userland/Libraries/LibWeb/CSS/Angle.h | 5 ---- Userland/Libraries/LibWeb/CSS/Display.h | 2 -- Userland/Libraries/LibWeb/CSS/Frequency.h | 5 ---- Userland/Libraries/LibWeb/CSS/Length.h | 4 --- Userland/Libraries/LibWeb/CSS/Percentage.h | 2 -- Userland/Libraries/LibWeb/CSS/Resolution.h | 5 ---- .../Libraries/LibWeb/CSS/StyleProperties.h | 1 - Userland/Libraries/LibWeb/CSS/StyleValue.h | 1 - Userland/Libraries/LibWeb/CSS/Time.h | 5 ---- Userland/Libraries/LibWeb/DOM/Position.h | 5 ---- Userland/Libraries/LibWeb/HTML/Origin.h | 1 - 40 files changed, 1 insertion(+), 180 deletions(-) diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index 9cc534ba5c6..246f3adb8d5 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -102,8 +102,6 @@ public: return !__builtin_memcmp(data(), other.data(), size()); } - bool operator!=(ByteBuffer const& other) const { return !(*this == other); } - [[nodiscard]] u8& operator[](size_t i) { VERIFY(i < m_size); diff --git a/AK/Complex.h b/AK/Complex.h index 365c19b3b40..4a21b9480e1 100644 --- a/AK/Complex.h +++ b/AK/Complex.h @@ -211,12 +211,6 @@ public: return (this->real() == a.real()) && (this->imag() == a.imag()); } - template - constexpr bool operator!=(Complex const& a) const - { - return !(*this == a); - } - constexpr Complex operator+() { return *this; diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 2c41ce47113..38156f57d3c 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -67,10 +67,6 @@ public: { return this->m_value == other.m_value; } - constexpr bool operator!=(Self const& other) const - { - return this->m_value != other.m_value; - } // Only implemented when `Incr` is true: constexpr Self& operator++() diff --git a/AK/FlyString.h b/AK/FlyString.h index 3cc12db8681..7d174952d2c 100644 --- a/AK/FlyString.h +++ b/AK/FlyString.h @@ -53,16 +53,12 @@ public: bool is_null() const { return !m_impl; } bool operator==(FlyString const& other) const { return m_impl == other.m_impl; } - bool operator!=(FlyString const& other) const { return m_impl != other.m_impl; } bool operator==(String const&) const; - bool operator!=(String const& string) const { return !(*this == string); } bool operator==(StringView) const; - bool operator!=(StringView string) const { return !(*this == string); } bool operator==(char const*) const; - bool operator!=(char const* string) const { return !(*this == string); } StringImpl const* impl() const { return m_impl; } char const* characters() const { return m_impl ? m_impl->characters() : nullptr; } diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index 8a0b63eec50..0ce5f87746f 100644 --- a/AK/IntrusiveList.h +++ b/AK/IntrusiveList.h @@ -80,7 +80,6 @@ public: T& operator*() { return *m_value; } auto operator->() { return m_value; } bool operator==(Iterator const& other) const { return other.m_value == m_value; } - bool operator!=(Iterator const& other) const { return !(*this == other); } Iterator& operator++() { m_value = IntrusiveList::next(m_value); @@ -108,7 +107,6 @@ public: T& operator*() { return *m_value; } auto operator->() { return m_value; } bool operator==(ReverseIterator const& other) const { return other.m_value == m_value; } - bool operator!=(ReverseIterator const& other) const { return !(*this == other); } ReverseIterator& operator++() { m_value = IntrusiveList::prev(m_value); @@ -134,7 +132,6 @@ public: T const& operator*() const { return *m_value; } auto operator->() const { return m_value; } bool operator==(ConstIterator const& other) const { return other.m_value == m_value; } - bool operator!=(ConstIterator const& other) const { return !(*this == other); } ConstIterator& operator++() { m_value = IntrusiveList::next(m_value); diff --git a/AK/JsonPath.h b/AK/JsonPath.h index dbb52f0ac80..c820213e4c9 100644 --- a/AK/JsonPath.h +++ b/AK/JsonPath.h @@ -75,10 +75,6 @@ public: } return false; } - bool operator!=(JsonPathElement const& other) const - { - return !(*this == other); - } private: Kind m_kind; diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index 990dd556920..22ac6eb701a 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -216,10 +216,8 @@ public: } bool operator==(NonnullRefPtr const& other) const { return m_ptr == other.m_ptr; } - bool operator!=(NonnullRefPtr const& other) const { return m_ptr != other.m_ptr; } bool operator==(NonnullRefPtr& other) { return m_ptr == other.m_ptr; } - bool operator!=(NonnullRefPtr& other) { return m_ptr != other.m_ptr; } // clang-format off private: diff --git a/AK/RefPtr.h b/AK/RefPtr.h index 9e06c900b9e..88b8ec2c697 100644 --- a/AK/RefPtr.h +++ b/AK/RefPtr.h @@ -260,29 +260,20 @@ public: ALWAYS_INLINE operator bool() { return !is_null(); } bool operator==(std::nullptr_t) const { return is_null(); } - bool operator!=(std::nullptr_t) const { return !is_null(); } bool operator==(RefPtr const& other) const { return as_ptr() == other.as_ptr(); } - bool operator!=(RefPtr const& other) const { return as_ptr() != other.as_ptr(); } bool operator==(RefPtr& other) { return as_ptr() == other.as_ptr(); } - bool operator!=(RefPtr& other) { return as_ptr() != other.as_ptr(); } template bool operator==(NonnullRefPtr const& other) const { return as_ptr() == other.m_ptr; } - template - bool operator!=(NonnullRefPtr const& other) const { return as_ptr() != other.m_ptr; } template bool operator==(NonnullRefPtr& other) { return as_ptr() == other.m_ptr; } - template - bool operator!=(NonnullRefPtr& other) { return as_ptr() != other.m_ptr; } bool operator==(T const* other) const { return as_ptr() == other; } - bool operator!=(T const* other) const { return as_ptr() != other; } bool operator==(T* other) { return as_ptr() == other; } - bool operator!=(T* other) { return as_ptr() != other; } ALWAYS_INLINE bool is_null() const { return !m_ptr; } diff --git a/AK/String.h b/AK/String.h index 1fb63362243..22986e182f7 100644 --- a/AK/String.h +++ b/AK/String.h @@ -203,13 +203,10 @@ public: [[nodiscard]] bool ends_with(char) const; bool operator==(String const&) const; - bool operator!=(String const& other) const { return !(*this == other); } bool operator==(StringView) const; - bool operator!=(StringView other) const { return !(*this == other); } bool operator==(FlyString const&) const; - bool operator!=(FlyString const& other) const { return !(*this == other); } bool operator<(String const&) const; bool operator<(char const*) const; @@ -222,7 +219,6 @@ public: bool operator<=(char const* other) const { return !(*this > other); } bool operator==(char const* cstring) const; - bool operator!=(char const* cstring) const { return !(*this == cstring); } [[nodiscard]] String isolated_copy() const; diff --git a/AK/StringUtils.h b/AK/StringUtils.h index 883196ecfbe..d828a21efaf 100644 --- a/AK/StringUtils.h +++ b/AK/StringUtils.h @@ -62,10 +62,6 @@ struct MaskSpan { { return start == other.start && length == other.length; } - bool operator!=(MaskSpan const& other) const - { - return !(*this == other); - } }; namespace StringUtils { diff --git a/AK/StringView.h b/AK/StringView.h index 8e65691e5a3..e73c1cddef9 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -245,11 +245,6 @@ public: return m_length == 1 && *m_characters == c; } - constexpr bool operator!=(char const* cstring) const - { - return !(*this == cstring); - } - #ifndef KERNEL bool operator==(String const&) const; #endif diff --git a/AK/Time.h b/AK/Time.h index 8e5d128269d..8778ce3bcc1 100644 --- a/AK/Time.h +++ b/AK/Time.h @@ -223,7 +223,6 @@ public: [[nodiscard]] bool is_negative() const { return m_seconds < 0; } bool operator==(Time const& other) const { return this->m_seconds == other.m_seconds && this->m_nanoseconds == other.m_nanoseconds; } - bool operator!=(Time const& other) const { return !(*this == other); } Time operator+(Time const& other) const; Time& operator+=(Time const& other); Time operator-(Time const& other) const; diff --git a/AK/UUID.cpp b/AK/UUID.cpp index 3c08fc7c526..72ca62ddafe 100644 --- a/AK/UUID.cpp +++ b/AK/UUID.cpp @@ -113,15 +113,6 @@ String UUID::to_string() const } #endif -bool UUID::operator==(const UUID& other) const -{ - for (size_t index = 0; index < 16; index++) { - if (m_uuid_buffer[index] != other.m_uuid_buffer[index]) - return false; - } - return true; -} - bool UUID::is_zero() const { return all_of(m_uuid_buffer, [](auto const octet) { return octet == 0; }); diff --git a/AK/UUID.h b/AK/UUID.h index c859cf3729d..bb3b5621116 100644 --- a/AK/UUID.h +++ b/AK/UUID.h @@ -31,12 +31,7 @@ public: UUID(StringView, Endianness endianness = Endianness::Little); ~UUID() = default; - bool operator==(const UUID&) const; - bool operator!=(const UUID& other) const { return !(*this == other); } - bool operator<=(const UUID&) const = delete; - bool operator>=(const UUID&) const = delete; - bool operator<(const UUID&) const = delete; - bool operator>(const UUID&) const = delete; + bool operator==(const UUID&) const = default; #ifdef KERNEL ErrorOr> to_string() const; diff --git a/AK/Utf16View.h b/AK/Utf16View.h index 3fb954b9528..bd6b30a9307 100644 --- a/AK/Utf16View.h +++ b/AK/Utf16View.h @@ -35,11 +35,6 @@ public: return (m_ptr == other.m_ptr) && (m_remaining_code_units == other.m_remaining_code_units); } - bool operator!=(Utf16CodePointIterator const& other) const - { - return !(*this == other); - } - Utf16CodePointIterator& operator++(); u32 operator*() const; diff --git a/AK/Utf32View.h b/AK/Utf32View.h index 249407f8c5f..7cbaa1f6db5 100644 --- a/AK/Utf32View.h +++ b/AK/Utf32View.h @@ -25,10 +25,6 @@ public: { return m_ptr == other.m_ptr && m_length == other.m_length; } - bool operator!=(Utf32CodePointIterator const& other) const - { - return !(*this == other); - } Utf32CodePointIterator& operator++() { VERIFY(m_length > 0); diff --git a/Userland/Applications/Spreadsheet/Position.h b/Userland/Applications/Spreadsheet/Position.h index a1f43ccd1c9..7bd73a0b705 100644 --- a/Userland/Applications/Spreadsheet/Position.h +++ b/Userland/Applications/Spreadsheet/Position.h @@ -37,11 +37,6 @@ struct Position { return row == other.row && column == other.column; } - bool operator!=(Position const& other) const - { - return !(other == *this); - } - String to_cell_identifier(Sheet const& sheet) const; URL to_url(Sheet const& sheet) const; diff --git a/Userland/Libraries/LibDebug/DebugInfo.h b/Userland/Libraries/LibDebug/DebugInfo.h index 43493c33132..d2f530d0506 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.h +++ b/Userland/Libraries/LibDebug/DebugInfo.h @@ -50,7 +50,6 @@ public: } bool operator==(SourcePosition const& other) const { return file_path == other.file_path && line_number == other.line_number; } - bool operator!=(SourcePosition const& other) const { return !(*this == other); } static SourcePosition from_line_info(Dwarf::LineProgram::LineInfo const&); }; diff --git a/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.h b/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.h index 75b23c69647..053dc735072 100644 --- a/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.h +++ b/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.h @@ -34,7 +34,6 @@ struct FlattenedDeviceTreeReserveEntry { BigEndian size; bool operator==(FlattenedDeviceTreeReserveEntry const& other) const { return other.address == address && other.size == size; } - bool operator!=(FlattenedDeviceTreeReserveEntry const& other) const { return !(operator==(other)); } }; static_assert(sizeof(FlattenedDeviceTreeReserveEntry) == 16, "FDT Memory Reservation entry size must match specification"); diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h index d24122d0fc6..a9473cb556d 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -33,11 +33,6 @@ public: return m_model == other.m_model && m_row == other.m_row && m_column == other.m_column && m_internal_data == other.m_internal_data; } - bool operator!=(ModelIndex const& other) const - { - return !(*this == other); - } - Model const* model() const { return m_model; } Variant data(ModelRole = ModelRole::Display) const; diff --git a/Userland/Libraries/LibGfx/Color.h b/Userland/Libraries/LibGfx/Color.h index ac1810640a6..eddd73b9266 100644 --- a/Userland/Libraries/LibGfx/Color.h +++ b/Userland/Libraries/LibGfx/Color.h @@ -350,11 +350,6 @@ public: return m_value == other.m_value; } - constexpr bool operator!=(Color const& other) const - { - return m_value != other.m_value; - } - String to_string() const; String to_string_without_alpha() const; static Optional from_string(StringView); diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h index 360eb91db35..5e4b39feec2 100644 --- a/Userland/Libraries/LibGfx/Point.h +++ b/Userland/Libraries/LibGfx/Point.h @@ -132,12 +132,6 @@ public: return x() == other.x() && y() == other.y(); } - template - [[nodiscard]] bool operator!=(Point const& other) const - { - return !(*this == other); - } - [[nodiscard]] Point operator+(Point const& other) const { return { m_x + other.m_x, m_y + other.m_y }; } Point& operator+=(Point const& other) diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index 4a204c5a4ad..a583da49e2c 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -477,12 +477,6 @@ public: return location() == other.location() && size() == other.size(); } - template - [[nodiscard]] bool operator!=(Rect const& other) const - { - return !(*this == other); - } - [[nodiscard]] Rect operator*(T factor) const { return { m_location * factor, m_size * factor }; } Rect& operator*=(T factor) diff --git a/Userland/Libraries/LibGfx/Size.h b/Userland/Libraries/LibGfx/Size.h index dc8722048b0..8054b5c71da 100644 --- a/Userland/Libraries/LibGfx/Size.h +++ b/Userland/Libraries/LibGfx/Size.h @@ -99,12 +99,6 @@ public: return width() == other.width() && height() == other.height(); } - template - [[nodiscard]] constexpr bool operator!=(Size const& other) const - { - return !(*this == other); - } - constexpr Size& operator-=(Size const& other) { m_width -= other.m_width; diff --git a/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h b/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h index 6713ab079d4..ddeef41f79d 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h @@ -59,7 +59,6 @@ public: } bool operator==(PropertyAttributes const& other) const { return m_bits == other.m_bits; } - bool operator!=(PropertyAttributes const& other) const { return m_bits != other.m_bits; } [[nodiscard]] u8 bits() const { return m_bits; } diff --git a/Userland/Libraries/LibLine/KeyCallbackMachine.h b/Userland/Libraries/LibLine/KeyCallbackMachine.h index 4d09ee1012d..f7861e1b887 100644 --- a/Userland/Libraries/LibLine/KeyCallbackMachine.h +++ b/Userland/Libraries/LibLine/KeyCallbackMachine.h @@ -38,11 +38,6 @@ struct Key { { return other.key == key && other.modifiers == modifiers; } - - bool operator!=(Key const& other) const - { - return !(*this == other); - } }; struct KeyCallback { diff --git a/Userland/Libraries/LibRegex/RegexMatch.h b/Userland/Libraries/LibRegex/RegexMatch.h index 04f2e0483bd..56f5273857d 100644 --- a/Userland/Libraries/LibRegex/RegexMatch.h +++ b/Userland/Libraries/LibRegex/RegexMatch.h @@ -310,11 +310,6 @@ public: [&](StringView view) { return view == cstring; }); } - bool operator!=(char const* cstring) const - { - return !(*this == cstring); - } - bool operator==(String const& string) const { return m_view.visit( @@ -333,11 +328,6 @@ public: [&](StringView view) { return view == string; }); } - bool operator!=(StringView other) const - { - return !(*this == other); - } - bool operator==(Utf32View const& other) const { return m_view.visit( @@ -349,11 +339,6 @@ public: [&](StringView view) { return view == RegexStringView { other }.to_string(); }); } - bool operator!=(Utf32View const& other) const - { - return !(*this == other); - } - bool operator==(Utf16View const& other) const { return m_view.visit( @@ -363,11 +348,6 @@ public: [&](StringView view) { return view == RegexStringView { other }.to_string(); }); } - bool operator!=(Utf16View const& other) const - { - return !(*this == other); - } - bool operator==(Utf8View const& other) const { return m_view.visit( @@ -377,11 +357,6 @@ public: [&](StringView view) { return other.as_string() == view; }); } - bool operator!=(Utf8View const& other) const - { - return !(*this == other); - } - bool equals(RegexStringView other) const { return other.m_view.visit([this](auto const& view) { return operator==(view); }); diff --git a/Userland/Libraries/LibSQL/HashIndex.h b/Userland/Libraries/LibSQL/HashIndex.h index b7f55198e8b..37caaaae1ef 100644 --- a/Userland/Libraries/LibSQL/HashIndex.h +++ b/Userland/Libraries/LibSQL/HashIndex.h @@ -118,9 +118,7 @@ public: [[nodiscard]] bool is_end() const { return !m_current; } bool operator==(HashIndexIterator const& other) const; - bool operator!=(HashIndexIterator const& other) const { return !(*this == other); } bool operator==(Key const& other) const; - bool operator!=(Key const& other) const { return !(*this == other); } HashIndexIterator operator++() { diff --git a/Userland/Libraries/LibVT/Attribute.h b/Userland/Libraries/LibVT/Attribute.h index a9c60ee80d8..a0919ad0e97 100644 --- a/Userland/Libraries/LibVT/Attribute.h +++ b/Userland/Libraries/LibVT/Attribute.h @@ -63,10 +63,6 @@ struct Attribute { { return foreground_color == other.foreground_color && background_color == other.background_color && flags == other.flags; } - constexpr bool operator!=(Attribute const& other) const - { - return !(*this == other); - } }; } diff --git a/Userland/Libraries/LibWeb/CSS/Angle.h b/Userland/Libraries/LibWeb/CSS/Angle.h index 4124df0bcaf..26c3be3eafe 100644 --- a/Userland/Libraries/LibWeb/CSS/Angle.h +++ b/Userland/Libraries/LibWeb/CSS/Angle.h @@ -43,11 +43,6 @@ public: return m_type == other.m_type && m_value == other.m_value; } - bool operator!=(Angle const& other) const - { - return !(*this == other); - } - private: StringView unit_name() const; diff --git a/Userland/Libraries/LibWeb/CSS/Display.h b/Userland/Libraries/LibWeb/CSS/Display.h index ba57ecaffe2..569d1aa09aa 100644 --- a/Userland/Libraries/LibWeb/CSS/Display.h +++ b/Userland/Libraries/LibWeb/CSS/Display.h @@ -35,8 +35,6 @@ public: VERIFY_NOT_REACHED(); } - bool operator!=(Display const& other) const { return !(*this == other); } - enum class Outside { Block, Inline, diff --git a/Userland/Libraries/LibWeb/CSS/Frequency.h b/Userland/Libraries/LibWeb/CSS/Frequency.h index 741f16497b2..e2f622c3986 100644 --- a/Userland/Libraries/LibWeb/CSS/Frequency.h +++ b/Userland/Libraries/LibWeb/CSS/Frequency.h @@ -40,11 +40,6 @@ public: return m_type == other.m_type && m_value == other.m_value; } - bool operator!=(Frequency const& other) const - { - return !(*this == other); - } - private: StringView unit_name() const; diff --git a/Userland/Libraries/LibWeb/CSS/Length.h b/Userland/Libraries/LibWeb/CSS/Length.h index 8daf331b2b1..2ac514e4339 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.h +++ b/Userland/Libraries/LibWeb/CSS/Length.h @@ -121,10 +121,6 @@ public: // We have a RefPtr member, but can't include the header StyleValue.h as it includes // this file already. To break the cyclic dependency, we must move all method definitions out. bool operator==(Length const& other) const; - bool operator!=(Length const& other) const - { - return !(*this == other); - } float relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, float font_size, float root_font_size) const; diff --git a/Userland/Libraries/LibWeb/CSS/Percentage.h b/Userland/Libraries/LibWeb/CSS/Percentage.h index 3a686f0ee5b..af894c76eec 100644 --- a/Userland/Libraries/LibWeb/CSS/Percentage.h +++ b/Userland/Libraries/LibWeb/CSS/Percentage.h @@ -37,7 +37,6 @@ public: } bool operator==(Percentage const& other) const { return m_value == other.m_value; } - bool operator!=(Percentage const& other) const { return !(*this == other); } private: float m_value; @@ -147,7 +146,6 @@ public: return (m_value.template get() == other.m_value.template get()); return (m_value.template get() == other.m_value.template get()); } - bool operator!=(PercentageOr const& other) const { return !(*this == other); } protected: bool is_t() const { return m_value.template has(); } diff --git a/Userland/Libraries/LibWeb/CSS/Resolution.h b/Userland/Libraries/LibWeb/CSS/Resolution.h index 589d0705090..be17e56431e 100644 --- a/Userland/Libraries/LibWeb/CSS/Resolution.h +++ b/Userland/Libraries/LibWeb/CSS/Resolution.h @@ -32,11 +32,6 @@ public: return m_type == other.m_type && m_value == other.m_value; } - bool operator!=(Resolution const& other) const - { - return !(*this == other); - } - private: StringView unit_name() const; diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.h b/Userland/Libraries/LibWeb/CSS/StyleProperties.h index 55f51fd020a..1aeafd6f59a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.h +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.h @@ -109,7 +109,6 @@ public: float line_height(Layout::Node const&) const; bool operator==(StyleProperties const&) const; - bool operator!=(StyleProperties const& other) const { return !(*this == other); } Optional position() const; Optional z_index() const; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index 5360447c18c..a454938273c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -402,7 +402,6 @@ public: virtual String to_string() const = 0; bool operator==(StyleValue const& other) const { return equals(other); } - bool operator!=(StyleValue const& other) const { return !(*this == other); } virtual bool equals(StyleValue const& other) const = 0; diff --git a/Userland/Libraries/LibWeb/CSS/Time.h b/Userland/Libraries/LibWeb/CSS/Time.h index 52c05603b70..f682d440dcd 100644 --- a/Userland/Libraries/LibWeb/CSS/Time.h +++ b/Userland/Libraries/LibWeb/CSS/Time.h @@ -41,11 +41,6 @@ public: return m_type == other.m_type && m_value == other.m_value; } - bool operator!=(Time const& other) const - { - return !(*this == other); - } - private: StringView unit_name() const; diff --git a/Userland/Libraries/LibWeb/DOM/Position.h b/Userland/Libraries/LibWeb/DOM/Position.h index a8405b66aba..0e4db3ee846 100644 --- a/Userland/Libraries/LibWeb/DOM/Position.h +++ b/Userland/Libraries/LibWeb/DOM/Position.h @@ -35,11 +35,6 @@ public: return m_node.ptr() == other.m_node.ptr() && m_offset == other.m_offset; } - bool operator!=(Position const& other) const - { - return !(*this == other); - } - String to_string() const; private: diff --git a/Userland/Libraries/LibWeb/HTML/Origin.h b/Userland/Libraries/LibWeb/HTML/Origin.h index c8a6e1a2a84..1d037518b8e 100644 --- a/Userland/Libraries/LibWeb/HTML/Origin.h +++ b/Userland/Libraries/LibWeb/HTML/Origin.h @@ -106,7 +106,6 @@ public: } bool operator==(Origin const& other) const { return is_same_origin(other); } - bool operator!=(Origin const& other) const { return !is_same_origin(other); } private: String m_scheme;