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 --- tools/configure/configureapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/configure') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 160ccf5778..555ccbf740 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1094,7 +1094,7 @@ void Configure::parseCmdLine() if (i == argCount) break; QString mod = configCmdLine.at(i); - if (!mod.startsWith(QStringLiteral("qt"))) + if (!mod.startsWith(QLatin1String("qt"))) mod.insert(0, QStringLiteral("qt")); if (!QFileInfo(sourcePath + "/../" + mod).isDir()) { cout << "Attempting to skip non-existent module " << mod << "." << endl; @@ -3810,7 +3810,7 @@ void Configure::displayConfig() env = "Unset"; sout << " PATH=\n " << env << endl; - if (dictionary[QStringLiteral("EDITION")] != QStringLiteral("OpenSource")) { + if (dictionary[QStringLiteral("EDITION")] != QLatin1String("OpenSource")) { QString l1 = dictionary[ "LICENSEE" ]; QString l2 = dictionary[ "LICENSEID" ]; QString l3 = dictionary["EDITION"] + ' ' + "Edition"; -- cgit v1.2.3