QColorTransform: optimize member-swap()

We know decltype(d), so we don't need to jump though the ADL-enabling
that qSwap() does. Just call QExplicitlySharedDataPointer's
member-swap directly.

Found through Clang -ftrace-time over PCH'ed libQt6Gui.so build:

  **** Templates that took longest to instantiate:
    [...]
    4050 ms: qSwap<QExplicitlySharedDataPointer<QColorTransformPrivate> > (87 times, avg 46 ms)

which is gone afterwards.

Task-number: QTBUG-97601
Pick-to: 6.3 6.2
Change-Id: Ie054848922a50dbf746781491cb28e598c0e12bc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2022-01-18 22:32:58 +01:00
parent 6dd09664b2
commit 5d4f8a947c

View File

@ -66,7 +66,7 @@ public:
}
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QColorTransform)
void swap(QColorTransform &other) noexcept { qSwap(d, other.d); }
void swap(QColorTransform &other) noexcept { d.swap(other.d); }
Q_GUI_EXPORT QRgb map(QRgb argb) const;
Q_GUI_EXPORT QRgba64 map(QRgba64 rgba64) const;