From 7931395d5bf30d783449e1696edf8d59b81462ed Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Date: Fri, 13 May 2016 13:45:48 +0200
Subject: [PATCH] remove pointless conversion to QString in isTrue()

Change-Id: I7766672018dd4acf9b9fb89acfe664671de4bc3d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
---
 qmake/library/qmakebuiltins.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index f11c55fc096..a77c83ea4f6 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -192,9 +192,8 @@ void QMakeEvaluator::initFunctionStatics()
         statics.functions.insert(ProKey(testInits[i].name), testInits[i].func);
 }
 
-static bool isTrue(const ProString &_str, QString &tmp)
+static bool isTrue(const ProString &str)
 {
-    const QString &str = _str.toQString(tmp);
     return !str.compare(statics.strtrue, Qt::CaseInsensitive) || str.toInt();
 }
 
@@ -904,7 +903,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
         } else {
             bool recursive = false;
             if (args.count() == 2)
-                recursive = isTrue(args.at(1), m_tmp2);
+                recursive = isTrue(args.at(1));
             QStringList dirs;
             QString r = m_option->expandEnvVars(args.at(0).toQString(m_tmp1))
                         .replace(QLatin1Char('\\'), QLatin1Char('/'));
@@ -1403,7 +1402,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
             flags = LoadSilent;
         if (args.count() >= 2) {
             parseInto = args.at(1).toQString(m_tmp2);
-            if (args.count() >= 3 && isTrue(args.at(2), m_tmp3))
+            if (args.count() >= 3 && isTrue(args.at(2)))
                 flags = LoadSilent;
         }
         QString fn = resolvePath(m_option->expandEnvVars(args.at(0).toQString(m_tmp1)));
@@ -1441,7 +1440,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
     case T_LOAD: {
         bool ignore_error = false;
         if (args.count() == 2) {
-            ignore_error = isTrue(args.at(1), m_tmp2);
+            ignore_error = isTrue(args.at(1));
         } else if (args.count() != 1) {
             evalError(fL1S("load(feature) requires one or two arguments."));
             return ReturnFalse;
-- 
GitLab