From 1a5c0b26d062a380fef1bb038a9d96cde7556dc6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 8 Oct 2014 11:35:24 +0200 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: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira --- src/gui/util/qdesktopservices.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/util') diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index eec9272aa1..60f9096a77 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -190,7 +190,7 @@ bool QDesktopServices::openUrl(const QUrl &url) qWarning("%s: The platform plugin does not support services.", Q_FUNC_INFO); return false; } - return url.scheme() == QStringLiteral("file") ? + return url.scheme() == QLatin1String("file") ? platformServices->openDocument(url) : platformServices->openUrl(url); } -- cgit v1.2.3