Don't use QByteArrayLiteral for a non-stored QByteArray

Unless you're creating a QByteArray that you will store, don't use
QByteArrayLiteral. Using it for 1 byte that is always concatenated to
something else is an extreme waste.

Change-Id: Icc29e4c4cb1d0aad1714bdeec8ff41da7c301af9
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Thiago Macieira 2012-04-18 14:47:32 +02:00 committed by Qt by Nokia
parent a633d80efe
commit 77cc912590

View File

@ -574,7 +574,7 @@ struct QMetaTypeIdQObject<T*, /* isPointerToTypeDerivedFromQObject */ true>
{
static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0);
if (!metatype_id.load())
metatype_id.storeRelease(qRegisterMetaType<T*>(QByteArray(T::staticMetaObject.className() + QByteArrayLiteral("*")).constData(),
metatype_id.storeRelease(qRegisterMetaType<T*>(QByteArray(T::staticMetaObject.className() + QByteArray("*")).constData(),
reinterpret_cast<T**>(quintptr(-1))));
return metatype_id.loadAcquire();
}