diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-08-11 19:22:58 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-27 17:23:57 +0000 |
commit | 811d8b82b541e94d154697cb854a29b09ae92a0d (patch) | |
tree | b1c5ef43e01ce576d2a3a51d86b37be3af25b46d /qmake/project.cpp | |
parent | 10e5ec25576eea821f2c767e62d00f80e9a01c94 (diff) |
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 <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r-- | qmake/project.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<ProStringList> &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<ProKey, ProFunctionDef>::ConstIterator it = m_functionDefs.testFunctions.constFind(func); @@ -99,9 +100,10 @@ QStringList QMakeProject::expand(const ProKey &func, const QList<ProStringList> { 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(); } |