diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-03-15 15:34:39 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-03-16 03:26:56 +0100 |
commit | 78891e53905591eb6736a69296b31e12c3195a55 (patch) | |
tree | 58132d5ae9efbbd892fddb28cd69e6cd4ec61b87 /src/corelib/text/qstring.h | |
parent | 156afbc9b855209b049b73176e03ce400881e96f (diff) |
QString/QByteArray: = default the move ctors
Instead of relying on implicit construction of the d-pointer and then
swapping that with other.d (using overly-generic qSwap(), no less),
simply let the compiler do The Right Thing™ via QArrayDataPointer's
move constructor.
Pick-to: 6.3 6.2
Task-number: QTBUG-97601
Change-Id: I3be30f99f6fb0e17d3550edbe64cbe80880e604a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r-- | src/corelib/text/qstring.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index b30f4ac981..a7f0f2451f 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -462,7 +462,7 @@ public: QString &operator=(const QString &) noexcept; QString &operator=(QLatin1String latin1); inline QString(QString &&other) noexcept - { qSwap(d, other.d); } + = default; QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QString) void swap(QString &other) noexcept { d.swap(other.d); } inline qsizetype size() const { return d.size; } |