summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-05-25 13:58:58 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-20 12:30:36 (GMT)
commit0e868a296df300e86c6e0055121b99b0d89da0f7 (patch)
tree611290bc6ea41ffc3b7bc1a97d830f6653e2a095 /tools/linguist/shared
parentc56cf26df98476b3679c859dfcdb7acb5f34012c (diff)
downloadQt-0e868a296df300e86c6e0055121b99b0d89da0f7.zip
Qt-0e868a296df300e86c6e0055121b99b0d89da0f7.tar.gz
Qt-0e868a296df300e86c6e0055121b99b0d89da0f7.tar.bz2
micro-optimize: (x.toLower() == y) => !x.compare(y, Qt:: CaseInsensitive)
cherry-picked dc0bc586462e2a74fba38f054d303d2226eec4e5 from creator
Diffstat (limited to 'tools/linguist/shared')
-rw-r--r--tools/linguist/shared/profileevaluator.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index aadf117..26deed6 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -694,7 +694,7 @@ void ProFileEvaluator::Private::visitProOperator(ProOperator *oper)
void ProFileEvaluator::Private::visitProCondition(ProCondition *cond)
{
if (!m_skipLevel) {
- if (cond->text().toLower() == QLatin1String("else")) {
+ if (!cond->text().compare(QLatin1String("else"), Qt::CaseInsensitive)) {
m_sts.condition = !m_sts.prevCondition;
} else {
m_sts.prevCondition = false;
@@ -1516,7 +1516,7 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
bool singleLine = true;
if (args.count() > 1)
- singleLine = (args[1].toLower() == QLatin1String("true"));
+ singleLine = (!args[1].compare(QLatin1String("true"), Qt::CaseInsensitive));
QFile qfile(file);
if (qfile.open(QIODevice::ReadOnly)) {
@@ -1590,7 +1590,7 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
FILE *proc = QT_POPEN(args[0].toLatin1(), "r");
bool singleLine = true;
if (args.count() > 1)
- singleLine = (args[1].toLower() == QLatin1String("true"));
+ singleLine = (!args[1].compare(QLatin1String("true"), Qt::CaseInsensitive));
QString output;
while (proc && !feof(proc)) {
int read_in = int(fread(buff, 1, 255, proc));
@@ -1672,7 +1672,7 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
} else {
bool recursive = false;
if (args.count() == 2)
- recursive = (args[1].toLower() == QLatin1String("true") || args[1].toInt());
+ recursive = (!args[1].compare(QLatin1String("true"), Qt::CaseInsensitive) || args[1].toInt());
QStringList dirs;
QString r = Option::fixPathToLocalOS(args[0]);
int slash = r.lastIndexOf(QDir::separator());
@@ -2171,7 +2171,7 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
bool ignore_error = false;
if (args.count() == 2) {
QString sarg = args[1];
- ignore_error = (sarg.toLower() == QLatin1String("true") || sarg.toInt());
+ ignore_error = (!sarg.compare(QLatin1String("true"), Qt::CaseInsensitive) || sarg.toInt());
} else if (args.count() != 1) {
q->logMessage(format("load(feature) requires one or two arguments."));
return ProItem::ReturnFalse;
@@ -2544,14 +2544,14 @@ ProFileEvaluator::TemplateType ProFileEvaluator::templateType()
{
QStringList templ = values(QLatin1String("TEMPLATE"));
if (templ.count() >= 1) {
- QString t = templ.last().toLower();
- if (t == QLatin1String("app"))
+ const QString &t = templ.last();
+ if (!t.compare(QLatin1String("app"), Qt::CaseInsensitive))
return TT_Application;
- if (t == QLatin1String("lib"))
+ if (!t.compare(QLatin1String("lib"), Qt::CaseInsensitive))
return TT_Library;
- if (t == QLatin1String("script"))
+ if (!t.compare(QLatin1String("script"), Qt::CaseInsensitive))
return TT_Script;
- if (t == QLatin1String("subdirs"))
+ if (!t.compare(QLatin1String("subdirs"), Qt::CaseInsensitive))
return TT_Subdirs;
}
return TT_Unknown;