forked from qt-creator/qt-creator
CMakePM: clang-tidy fix for 'performance-implicit-conversion-in-loop'
Change-Id: I67e5adad19a3454986381c5548bbe96cf1cc1e6a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -91,7 +91,7 @@ std::vector<int> indexList(const QJsonValue &v)
|
||||
std::vector<int> result;
|
||||
result.reserve(static_cast<size_t>(indexList.count()));
|
||||
|
||||
for (const QJsonValue &v : indexList) {
|
||||
for (const auto &v : indexList) {
|
||||
result.push_back(v.toInt(-1));
|
||||
}
|
||||
return result;
|
||||
@@ -139,7 +139,7 @@ static ReplyFileContents readReplyFile(const FilePath &filePath, QString &errorM
|
||||
bool hadInvalidObject = false;
|
||||
{
|
||||
const QJsonArray objects = rootObject.value("objects").toArray();
|
||||
for (const QJsonValue &v : objects) {
|
||||
for (const auto &v : objects) {
|
||||
const QJsonObject object = v.toObject();
|
||||
{
|
||||
ReplyObject r;
|
||||
@@ -178,7 +178,7 @@ static CMakeConfig readCacheFile(const FilePath &cacheFile, QString &errorMessag
|
||||
}
|
||||
|
||||
const QJsonArray entries = root.value("entries").toArray();
|
||||
for (const QJsonValue &v : entries) {
|
||||
for (const auto &v : entries) {
|
||||
CMakeConfigItem item;
|
||||
|
||||
const QJsonObject entry = v.toObject();
|
||||
@@ -190,7 +190,7 @@ static CMakeConfig readCacheFile(const FilePath &cacheFile, QString &errorMessag
|
||||
|
||||
{
|
||||
const QJsonArray properties = entry.value("properties").toArray();
|
||||
for (const QJsonValue &v : properties) {
|
||||
for (const auto &v : properties) {
|
||||
const QJsonObject prop = v.toObject();
|
||||
auto nv = nameValue(prop);
|
||||
if (nv.first == "ADVANCED") {
|
||||
@@ -223,7 +223,7 @@ static std::vector<CMakeFileInfo> readCMakeFilesFile(const FilePath &cmakeFilesF
|
||||
}
|
||||
|
||||
const QJsonArray inputs = root.value("inputs").toArray();
|
||||
for (const QJsonValue &v : inputs) {
|
||||
for (const auto &v : inputs) {
|
||||
CMakeFileInfo info;
|
||||
const QJsonObject input = v.toObject();
|
||||
info.path = cmakeFilesFile.withNewPath(input.value("path").toString());
|
||||
@@ -253,7 +253,7 @@ std::vector<Directory> extractDirectories(const QJsonArray &directories, QString
|
||||
}
|
||||
|
||||
std::vector<Directory> result;
|
||||
for (const QJsonValue &v : directories) {
|
||||
for (const auto &v : directories) {
|
||||
const QJsonObject obj = v.toObject();
|
||||
if (obj.isEmpty()) {
|
||||
errorMessage = Tr::tr(
|
||||
@@ -283,7 +283,7 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString
|
||||
}
|
||||
|
||||
std::vector<Project> result;
|
||||
for (const QJsonValue &v : projects) {
|
||||
for (const auto &v : projects) {
|
||||
const QJsonObject obj = v.toObject();
|
||||
if (obj.isEmpty()) {
|
||||
qCDebug(cmakeFileApi) << "Empty project skipped!";
|
||||
@@ -314,7 +314,7 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString
|
||||
static std::vector<Target> extractTargets(const QJsonArray &targets, QString &errorMessage)
|
||||
{
|
||||
std::vector<Target> result;
|
||||
for (const QJsonValue &v : targets) {
|
||||
for (const auto &v : targets) {
|
||||
const QJsonObject obj = v.toObject();
|
||||
if (obj.isEmpty()) {
|
||||
errorMessage = Tr::tr(
|
||||
@@ -436,7 +436,7 @@ static std::vector<Configuration> extractConfigurations(const QJsonArray &config
|
||||
}
|
||||
|
||||
std::vector<FileApiDetails::Configuration> result;
|
||||
for (const QJsonValue &v : configs) {
|
||||
for (const auto &v : configs) {
|
||||
const QJsonObject obj = v.toObject();
|
||||
if (obj.isEmpty()) {
|
||||
errorMessage = Tr::tr(
|
||||
|
||||
Reference in New Issue
Block a user