qmake: don't iterate over .keys()
... iterate over the container itself instead. Avoids temporary QList creation as well as the lookup cost when actually calling value(key). Change-Id: Icac867c30e63863cfa44a382eedd4d6df2070a59 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
parent
dce2612a7c
commit
c9cb20c01a
@ -893,12 +893,10 @@ void VcprojGenerator::init()
|
||||
}
|
||||
|
||||
#if 0 // Debugging
|
||||
Q_FOREACH(QString aKey, extraCompilerSources.keys()) {
|
||||
qDebug("Extracompilers for %s are (%s)", aKey.toLatin1().constData(), extraCompilerSources.value(aKey).join(", ").toLatin1().constData());
|
||||
}
|
||||
Q_FOREACH(QString aKey, extraCompilerOutputs.keys()) {
|
||||
qDebug("Object mapping for %s is (%s)", aKey.toLatin1().constData(), extraCompilerOutputs.value(aKey).join(", ").toLatin1().constData());
|
||||
}
|
||||
for (auto it = extraCompilerSources.cbegin(), end = extraCompilerSources.cend(); it != end; ++it)
|
||||
qDebug("Extracompilers for %s are (%s)", it.key().toLatin1().constData(), it.value().join(", ").toLatin1().constData());
|
||||
for (auto it = extraCompilerOutputs.cbegin(), end = extraCompilerOutputs.cend(); it != end; ++it)
|
||||
qDebug("Object mapping for %s is (%s)", it.key().toLatin1().constData(), it.value().join(", ").toLatin1().constData());
|
||||
qDebug("");
|
||||
#endif
|
||||
}
|
||||
|
@ -302,8 +302,8 @@ static void addJsonArray(const QJsonArray &array, const QString &keyPrefix, ProV
|
||||
|
||||
static void addJsonObject(const QJsonObject &object, const QString &keyPrefix, ProValueMap *map)
|
||||
{
|
||||
foreach (const QString &key, object.keys())
|
||||
addJsonValue(object.value(key), keyPrefix + key, map);
|
||||
for (auto it = object.begin(), end = object.end(); it != end; ++it)
|
||||
addJsonValue(it.value(), keyPrefix + it.key(), map);
|
||||
|
||||
insertJsonKeyValue(keyPrefix + QLatin1String("_KEYS_"), object.keys(), map);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user