From 49403ef7a2731486df3793c07c010099715ba1be Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 25 Jun 2015 10:17:08 +0200 Subject: QIcon: use (Qt-) canonical form of move special member functions In particular the move constructor now performs only two instead of four assignments. Change-Id: I033d75635288fbd44060a1ba5f2da23b7e7729f6 Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/image/qicon.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h index 63e77eef99..c33a1f2698 100644 --- a/src/gui/image/qicon.h +++ b/src/gui/image/qicon.h @@ -56,8 +56,8 @@ public: QIcon(const QIcon &other); #ifdef Q_COMPILER_RVALUE_REFS QIcon(QIcon &&other) Q_DECL_NOEXCEPT - : d(0) - { qSwap(d, other.d); } + : d(other.d) + { other.d = Q_NULLPTR; } #endif explicit QIcon(const QString &fileName); // file or resource name explicit QIcon(QIconEngine *engine); @@ -65,7 +65,7 @@ public: QIcon &operator=(const QIcon &other); #ifdef Q_COMPILER_RVALUE_REFS inline QIcon &operator=(QIcon &&other) Q_DECL_NOEXCEPT - { qSwap(d, other.d); return *this; } + { swap(other); return *this; } #endif inline void swap(QIcon &other) Q_DECL_NOEXCEPT { qSwap(d, other.d); } -- cgit v1.2.3