diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-10-08 12:41:28 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2014-10-09 09:42:11 +0200 |
commit | 1cc06b2e9499b65ac30bbc667cf99e0077c48af7 (patch) | |
tree | 0d61af1521063330d71eb97a37e392e3a9e63d2f /src/widgets/styles | |
parent | 1a5c0b26d062a380fef1bb038a9d96cde7556dc6 (diff) |
Don't use QStringLiteral in startsWith/endsWidth
For QLatin1String, startsWith/endsWith is overloaded, so comparing to
a latin-1 (C) string literal is efficient, since strlen() is
comparatively fast.
OTOH, QStringLiteral, when not using RVO, litters the code with
QString dtor calls, which are not inline. Worse, absent lambdas,
it even allocates memory.
So, just use QLatin1String instead.
Change-Id: I7eaf464c67b55116f970fe7f58a85f19ce4d254e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index a78990e79b..a6c7f5dde2 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -2485,7 +2485,7 @@ void QStyleSheetStyle::setProperties(QWidget *w) QSet<const QString> propertySet; for (int i = decls.count() - 1; i >= 0; --i) { const QString property = decls.at(i).d->property; - if (!property.startsWith(QStringLiteral("qproperty-"), Qt::CaseInsensitive)) + if (!property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)) continue; if (!propertySet.contains(property)) { propertySet.insert(property); |