summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-02-26 22:33:29 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-28 17:59:51 +0100
commit40519146419cccf30e392b08fcf3db755ad288a1 (patch)
tree6200661e482728ea8984dee57b6cd6b26d009d6f /src
parent24040ca43cf0b8bff9a2283aed79b578fcdd6cdc (diff)
QPalette: optimize move assignment operator
Instead of assigning the various bit-fields manually, use the quint32 union field, which is already present to avoid slow bit-field operations in the member-swap function. Verifed that the generated assembly for move-assignment is significantly better than before on GCC. Change-Id: If4e0ef678bf3a496c6eb369ad3f639f5a9bc79fc Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qpalette.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
index 9abca30f12..8d9754d388 100644
--- a/src/gui/kernel/qpalette.h
+++ b/src/gui/kernel/qpalette.h
@@ -72,8 +72,7 @@ public:
#ifdef Q_COMPILER_RVALUE_REFS
inline QPalette &operator=(QPalette &&other)
{
- data.resolve_mask = other.data.resolve_mask;
- data.current_group = other.data.current_group;
+ for_faster_swapping_dont_use = other.for_faster_swapping_dont_use;
qSwap(d, other.d); return *this;
}
#endif