summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-11 17:27:16 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-05-11 18:25:08 +0200
commit99b81083ccee7e1bd28749b1066599670713cefe (patch)
treef3e3c7fb18bfd9683cc02c1464b2af0acc17fc23 /src
parent3b4ed3123fde1f6e6d47b004cb5a4795b0d64387 (diff)
downloadqtwebengine-99b81083ccee7e1bd28749b1066599670713cefe.tar.gz
QtWebEngine: replace qSwap with member-swap where possible
qSwap() is a monster that looks for ADL overloads of swap() and also detects the noexcept of the wrapped swap() function, so it should only be used when the argument type is unknown. In the vast majority of cases, the type is known to be efficiently std::swap()able or to have a member-swap. Call either of these. As a drive-by, unify all member-swap()s to be noexcept. Task-number: QTBUG-97601 Pick-to: 6.3 6.2 5.15 Change-Id: I9184cab0ed74a1b32d62cf7c83dc1f1b7814c784 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/api/qwebenginehistory.h2
-rw-r--r--src/core/api/qwebenginehttprequest.h2
-rw-r--r--src/core/api/qwebenginescript.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/core/api/qwebenginehistory.h b/src/core/api/qwebenginehistory.h
index 6afb8d8c1..2e5dfcd9a 100644
--- a/src/core/api/qwebenginehistory.h
+++ b/src/core/api/qwebenginehistory.h
@@ -74,7 +74,7 @@ public:
bool isValid() const;
- void swap(QWebEngineHistoryItem &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QWebEngineHistoryItem &other) noexcept { d.swap(other.d); }
private:
QWebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv);
diff --git a/src/core/api/qwebenginehttprequest.h b/src/core/api/qwebenginehttprequest.h
index b302217f2..65b2e8f98 100644
--- a/src/core/api/qwebenginehttprequest.h
+++ b/src/core/api/qwebenginehttprequest.h
@@ -73,7 +73,7 @@ public:
QWebEngineHttpRequest &operator=(const QWebEngineHttpRequest &other);
static QWebEngineHttpRequest postRequest(const QUrl &url, const QMap<QString, QString> &postData);
- void swap(QWebEngineHttpRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QWebEngineHttpRequest &other) noexcept { d.swap(other.d); }
bool operator==(const QWebEngineHttpRequest &other) const;
inline bool operator!=(const QWebEngineHttpRequest &other) const { return !operator==(other); }
diff --git a/src/core/api/qwebenginescript.h b/src/core/api/qwebenginescript.h
index a9b1bb869..4d2ecd2e5 100644
--- a/src/core/api/qwebenginescript.h
+++ b/src/core/api/qwebenginescript.h
@@ -107,7 +107,7 @@ public:
bool operator==(const QWebEngineScript &other) const;
inline bool operator!=(const QWebEngineScript &other) const
{ return !operator==(other); }
- void swap(QWebEngineScript &other) { qSwap(d, other.d); }
+ void swap(QWebEngineScript &other) noexcept { d.swap(other.d); }
private:
friend class QWebEngineScriptCollectionPrivate;