CMakeProjectManager: Limit the usage of std::make_pair

Make the code less verbose.

Change-Id: I8dc194f0cb4ed38c4c117482a7011019444edc40
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Jarek Kobus
2022-09-30 14:58:22 +02:00
parent 55efe40a58
commit 5ab100a2b9
3 changed files with 9 additions and 11 deletions

View File

@@ -52,7 +52,7 @@ static std::pair<int, int> cmakeVersion(const QJsonObject &obj)
const QJsonObject version = obj.value("version").toObject();
const int major = version.value("major").toInt(-1);
const int minor = version.value("minor").toInt(-1);
return std::make_pair(major, minor);
return {major, minor};
}
static bool checkJsonObject(const QJsonObject &obj, const QString &kind, int major, int minor = -1)
@@ -67,7 +67,7 @@ static bool checkJsonObject(const QJsonObject &obj, const QString &kind, int maj
static std::pair<QString, QString> nameValue(const QJsonObject &obj)
{
return std::make_pair(obj.value("name").toString(), obj.value("value").toString());
return {obj.value("name").toString(), obj.value("value").toString()};
}
static QJsonDocument readJsonFile(const FilePath &filePath)