Commit 9b9c4a96 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Oswald Buddenhagen
Browse files

de-duplicate code



Change-Id: Ic056acf739659215241c1cab6a462b1ab591dc78
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/fb143abbfb28d8433b908b09b37b4c7720357892)
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent ccbcdf89
......@@ -1266,9 +1266,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return ReturnFalse;
}
int cnt = values(map(args.at(0))).count();
int val = args.at(1).toQString(m_tmp1).toInt();
if (args.count() == 3) {
const ProString &comp = args.at(2);
const int val = args.at(1).toQString(m_tmp1).toInt();
if (comp == QLatin1String(">") || comp == QLatin1String("greaterThan")) {
return returnBool(cnt > val);
} else if (comp == QLatin1String(">=")) {
......@@ -1279,13 +1279,13 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return returnBool(cnt <= val);
} else if (comp == QLatin1String("equals") || comp == QLatin1String("isEqual")
|| comp == QLatin1String("=") || comp == QLatin1String("==")) {
return returnBool(cnt == val);
// fallthrough
} else {
evalError(fL1S("Unexpected modifier to count(%2).").arg(comp.toQString(m_tmp1)));
return ReturnFalse;
}
}
return returnBool(cnt == args.at(1).toQString(m_tmp1).toInt());
return returnBool(cnt == val);
}
case T_GREATERTHAN:
case T_LESSTHAN: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment