From 78dfb5f196039be56222baaf1442dd49e9c85cb9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 6 Nov 2024 11:37:02 +0100 Subject: [PATCH] QDomNodeList: mark op==(Private) noexcept It is, because it only compares a pointer and a string, both of which are nothrow_equality_comparable. Also remove the unused (even in C++17 mode) inequality operator instead of marking it noexcept, too. Pick-to: 6.5 6.2 Change-Id: I0ce62df02ffc98252d17cef659cc6dc2a90ae2cf Reviewed-by: Rym Bouabid Reviewed-by: Ivan Solovev (cherry picked from commit 3fce04157dbba1232d96821dbb166c6a5dc467a8) Reviewed-by: Qt Cherry-pick Bot --- src/xml/dom/qdom.cpp | 7 +------ src/xml/dom/qdom_p.h | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 043fd3a6855..64f32030c87 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -639,16 +639,11 @@ QDomNodeListPrivate::~QDomNodeListPrivate() delete node_impl; } -bool QDomNodeListPrivate::operator==(const QDomNodeListPrivate &other) const +bool QDomNodeListPrivate::operator==(const QDomNodeListPrivate &other) const noexcept { return (node_impl == other.node_impl) && (tagname == other.tagname); } -bool QDomNodeListPrivate::operator!=(const QDomNodeListPrivate &other) const -{ - return !operator==(other); -} - void QDomNodeListPrivate::createList() const { if (!node_impl) diff --git a/src/xml/dom/qdom_p.h b/src/xml/dom/qdom_p.h index 2a8e2deac0c..507852b89e6 100644 --- a/src/xml/dom/qdom_p.h +++ b/src/xml/dom/qdom_p.h @@ -140,8 +140,7 @@ public: QDomNodeListPrivate(QDomNodePrivate *, const QString &, const QString &); ~QDomNodeListPrivate(); - bool operator==(const QDomNodeListPrivate &) const; - bool operator!=(const QDomNodeListPrivate &) const; + bool operator==(const QDomNodeListPrivate &) const noexcept; void createList() const; bool maybeCreateList() const;