From bf1df558461f21827eaad9d5d9541def784980a2 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 8 Oct 2014 10:26:27 +0200 Subject: Don't use QByteArrayLiteral in comparisons For const char*s, operator== is overloaded, so comparing to a (C) string literal is efficient, since qstrcmp doesn't require the length of the strings to compare. OTOH, QByteArrayLiteral, when not using RVO, litters the code with QByteArray dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare with a (C) string literal instead. Change-Id: Id3bfdc89558ba51911f6317a7a73c287f96e6f24 Reviewed-by: Thiago Macieira --- src/plugins/platforms/windows/qwindowsscaling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowsscaling.cpp') diff --git a/src/plugins/platforms/windows/qwindowsscaling.cpp b/src/plugins/platforms/windows/qwindowsscaling.cpp index ae1a7d4ded..8f0dab82f6 100644 --- a/src/plugins/platforms/windows/qwindowsscaling.cpp +++ b/src/plugins/platforms/windows/qwindowsscaling.cpp @@ -58,7 +58,7 @@ int QWindowsScaling::determineUiScaleFactor() return 1; const QByteArray envDevicePixelRatioEnv = qgetenv(devicePixelRatioEnvVar); // Auto: Suggest a scale factor by checking monitor resolution. - if (envDevicePixelRatioEnv == QByteArrayLiteral("auto")) { + if (envDevicePixelRatioEnv == "auto") { const int maxResolution = QWindowsScreen::maxMonitorHorizResolution(); return maxResolution > 180 ? maxResolution / 96 : 1; } -- cgit v1.2.3