summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-05-07 20:19:40 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-06 16:08:02 +0200
commit7d63fa6edcbe706bf0eab2c7e24efa1ed8940e6d (patch)
treed70ab41cbfb283b8f8ff6444dd8454d581791f81 /src/gui/image/qimage.cpp
parent8f2c57ddb2842c0983a36bca44c1810d58cbc370 (diff)
QtGui: replace some copies with swaps
This provides move speed even for non-C++11 compilers and avoids having to call the copy assignment operator from within copy ctors. (which will result in infinite recursion when using the copy-swap idiom). Change-Id: I379bc8bf2c72d9f986c0f17f9eef56cd592e7a06 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r--src/gui/image/qimage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index b16ae2ffce..71ec636839 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -983,7 +983,7 @@ QImage::QImage(const QImage &image)
{
if (image.paintingActive() || isLocked(image.d)) {
d = 0;
- operator=(image.copy());
+ image.copy().swap(*this);
} else {
d = image.d;
if (d)