From 0f27d11285bbc22c4f440315ba3a9b7627fc449b Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Tue, 19 Jan 2016 11:49:37 +0300 Subject: Don't use QStringLiteral in comparisons For QLatin1String, operator== 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 compare using QLatin1String instead. Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2 Reviewed-by: Thiago Macieira Reviewed-by: Marc Mutz --- src/plugins/printsupport/cocoa/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/printsupport') diff --git a/src/plugins/printsupport/cocoa/main.cpp b/src/plugins/printsupport/cocoa/main.cpp index 3db7b49ba4..2733c3fa60 100644 --- a/src/plugins/printsupport/cocoa/main.cpp +++ b/src/plugins/printsupport/cocoa/main.cpp @@ -49,7 +49,7 @@ public: QPlatformPrinterSupport *QCocoaPrinterSupportPlugin::create(const QString &key) { - if (key.compare(key, QStringLiteral("cocoaprintersupport"), Qt::CaseInsensitive) != 0) + if (key.compare(key, QLatin1String("cocoaprintersupport"), Qt::CaseInsensitive) != 0) return 0; QGuiApplication *app = qobject_cast(QCoreApplication::instance()); if (!app) -- cgit v1.2.3