diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2024-04-03 16:23:43 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2024-04-04 11:10:53 +0000 |
commit | 4770a140f52004688587524d70e67555daa8e417 (patch) | |
tree | 5e23e54cf2b912815c41cae5b813d1ca29b6c0ef | |
parent | 92468e7f2555dfbf2129d5d368b95eab62f66e51 (diff) |
Any: make equals(other) free and name it comparesEqual
To go along with standardization in the rest of Qt
Task-number: QTBUG-123627
Change-Id: Ib43b43ed375a294e3bf22bc7108199a3c6524e99
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
-rw-r--r-- | src/wellknown/qprotobufanysupport.cpp | 4 | ||||
-rw-r--r-- | src/wellknown/qprotobufanysupport.h | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/wellknown/qprotobufanysupport.cpp b/src/wellknown/qprotobufanysupport.cpp index de21832..ed5172c 100644 --- a/src/wellknown/qprotobufanysupport.cpp +++ b/src/wellknown/qprotobufanysupport.cpp @@ -278,9 +278,9 @@ QAnyStringView Any::defaultUrlPrefix() return u"type.googleapis.com"; } -bool Any::equals(const Any &other) const noexcept +bool comparesEqual(const Any &lhs, const Any &rhs) noexcept { - return typeUrl() == other.typeUrl() && value() == other.value(); + return lhs.typeUrl() == rhs.typeUrl() && lhs.value() == rhs.value(); } /*! diff --git a/src/wellknown/qprotobufanysupport.h b/src/wellknown/qprotobufanysupport.h index 2a46a83..fa60207 100644 --- a/src/wellknown/qprotobufanysupport.h +++ b/src/wellknown/qprotobufanysupport.h @@ -89,15 +89,15 @@ private: static QAnyStringView defaultUrlPrefix(); - [[nodiscard]] - bool equals(const Any &other) const noexcept; + friend Q_PROTOBUFWELLKNOWNTYPES_EXPORT bool + comparesEqual(const Any &lhs, const Any &rhs) noexcept; friend bool operator==(const Any &lhs, const Any &rhs) noexcept { - return lhs.equals(rhs); + return comparesEqual(lhs, rhs); } friend bool operator!=(const Any &lhs, const Any &rhs) noexcept { - return !lhs.equals(rhs); + return !comparesEqual(lhs, rhs); } }; } // namespace QtProtobuf |