CMake: Use callback-based environment iteration

Hides underlying data structure.

Task-number: QTCREATORBUG-28357
Change-Id: Ib0d7fb70afa820b1bd28d23e12b9379a6de6546b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-03-01 16:27:47 +01:00
parent 9feef11b5d
commit 34fd28327d
2 changed files with 26 additions and 35 deletions

View File

@@ -456,9 +456,9 @@ static QHash<QString, QString> merge(const QHash<QString, QString> &first,
static Utils::Environment merge(const Utils::Environment &first, const Utils::Environment &second)
{
Utils::Environment result = first;
for (auto it = second.constBegin(); it != second.constEnd(); ++it) {
result.set(it.key().name, it.value().first);
}
second.forEachEntry([&](const QString &key, const QString &value, bool) {
result.set(key, value);
});
return result;
}