From 811d8b82b541e94d154697cb854a29b09ae92a0d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 11 Aug 2017 19:22:58 +0200 Subject: qmake: make argument validation of built-ins data driven at the time this patch was conceived, it was meant as an exercise in getting rid of usages of ProString::toQString(m_tmp). however, this was meanwhile superseded by use of toQStringView(). but the change itself should have been done a long time ago already, and there is no harm in going through with it. on the way, this also unifies and fixes some of the error messages. Change-Id: I337aff994c508df783df4794c3fa0762d83a691b Reviewed-by: Joerg Bornemann --- qmake/project.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'qmake/project.cpp') diff --git a/qmake/project.cpp b/qmake/project.cpp index e6bdb04bfb..1bc9b352b5 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -82,8 +82,9 @@ bool QMakeProject::test(const ProKey &func, const QList &args) { m_current.clear(); - if (int func_t = statics.functions.value(func)) - return boolRet(evaluateBuiltinConditional(func_t, func, prepareBuiltinArgs(args))); + auto adef = statics.functions.constFind(func); + if (adef != statics.functions.constEnd()) + return boolRet(evaluateBuiltinConditional(*adef, func, prepareBuiltinArgs(args))); QHash::ConstIterator it = m_functionDefs.testFunctions.constFind(func); @@ -99,9 +100,10 @@ QStringList QMakeProject::expand(const ProKey &func, const QList { m_current.clear(); - if (int func_t = statics.expands.value(func)) { + auto adef = statics.expands.constFind(func); + if (adef != statics.expands.constEnd()) { ProStringList ret; - if (evaluateBuiltinExpand(func_t, func, prepareBuiltinArgs(args), ret) == ReturnError) + if (evaluateBuiltinExpand(*adef, func, prepareBuiltinArgs(args), ret) == ReturnError) exit(3); return ret.toQStringList(); } -- cgit v1.2.3