Skip to content

Commit

Permalink
Eliminate need for index in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Jun 14, 2024
1 parent cb71186 commit 3aad079
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tools/ts-generator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ StudyParamsForLinkTS readGeneralParamsForLinksTS(fs::path studyDir)

std::vector<LinkTSgenerationParams> CreateLinkList(const LinkPairs& linksFromCmdLine)
{
std::vector<LinkTSgenerationParams> to_return(linksFromCmdLine.size());
// gp : following loop should be improved : we shouldn't need an index
unsigned int index = 0;
std::vector<LinkTSgenerationParams> to_return;
to_return.reserve(linksFromCmdLine.size());
for (const auto& link_pair : linksFromCmdLine)
{
to_return[index].namesPair = link_pair;
index++;
LinkTSgenerationParams params;
params.namesPair = link_pair;
to_return.push_back(std::move(params));
}
return to_return;
}
Expand Down

0 comments on commit 3aad079

Please sign in to comment.