diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-19 11:49:37 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-28 18:00:47 +0000 |
commit | 0f27d11285bbc22c4f440315ba3a9b7627fc449b (patch) | |
tree | 3e384b64c92b33cd6475bf7e91d659ac67f71463 /tools | |
parent | 58f8dd4f92e0e647ed530554d7edf3d1a901f552 (diff) | |
download | qtbase-0f27d11285bbc22c4f440315ba3a9b7627fc449b.tar.gz |
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 <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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"; |