Commit 63f6fd14 authored by Pavel Solodovnikov's avatar Pavel Solodovnikov
Browse files

Meta: modernize old-fashioned loops to range-based `for` (CTest).

Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
parent 420874bf
......@@ -373,9 +373,8 @@ bool cmCTestBZR::UpdateImpl()
bzr_update.push_back(this->CommandLineTool.c_str());
bzr_update.push_back("pull");
for (std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) {
bzr_update.push_back(ai->c_str());
for (std::string const& arg : args) {
bzr_update.push_back(arg.c_str());
}
bzr_update.push_back(this->URL.c_str());
......
......@@ -29,10 +29,9 @@ void cmCTestBatchTestHandler::WriteBatchScript()
fout.open(this->Script.c_str());
fout << "#!/bin/sh\n";
for (TestMap::iterator i = this->Tests.begin(); i != this->Tests.end();
++i) {
this->WriteSrunArgs(i->first, fout);
this->WriteTestCommand(i->first, fout);
for (auto const& t : this->Tests) {
this->WriteSrunArgs(t.first, fout);
this->WriteTestCommand(t.first, fout);
fout << "\n";
}
fout.flush();
......@@ -80,9 +79,8 @@ void cmCTestBatchTestHandler::WriteTestCommand(int test, std::ostream& fout)
this->TestHandler->GenerateTestCommand(processArgs, test);
processArgs.push_back(command);
for (std::vector<std::string>::iterator arg = processArgs.begin();
arg != processArgs.end(); ++arg) {
fout << *arg << " ";
for (std::string const& arg : processArgs) {
fout << arg << " ";
}
std::vector<std::string>::iterator i = args.begin();
......
......@@ -45,7 +45,6 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
std::string& cmakeOutString,
cmake* cm)
{
unsigned int k;
std::vector<std::string> args;
args.push_back(cmSystemTools::GetCMakeCommand());
args.push_back(this->SourceDir);
......@@ -80,8 +79,8 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
args.push_back(btype);
}
for (k = 0; k < this->BuildOptions.size(); ++k) {
args.push_back(this->BuildOptions[k]);
for (std::string const& opt : this->BuildOptions) {
args.push_back(opt);
}
if (cm->Run(args) != 0) {
out << "Error: cmake execution failed\n";
......@@ -219,12 +218,10 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
// do the build
std::vector<std::string>::iterator tarIt;
if (this->BuildTargets.empty()) {
this->BuildTargets.push_back("");
}
for (tarIt = this->BuildTargets.begin(); tarIt != this->BuildTargets.end();
++tarIt) {
for (std::string const& tar : this->BuildTargets) {
double remainingTime = 0;
if (this->Timeout > 0) {
remainingTime = this->Timeout - cmSystemTools::GetTime() + clock_start;
......@@ -249,7 +246,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
config = "Debug";
}
int retVal = cm.GetGlobalGenerator()->Build(
this->SourceDir, this->BinaryDir, this->BuildProject, *tarIt, output,
this->SourceDir, this->BinaryDir, this->BuildProject, tar, output,
this->BuildMakeProgram, config, !this->BuildNoClean, false, false,
remainingTime);
out << output;
......@@ -292,8 +289,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
<< this->TestCommand << "\n";
out << "tried to find it in these places:\n";
out << fullPath << "\n";
for (unsigned int i = 0; i < failed.size(); ++i) {
out << failed[i] << "\n";
for (std::string const& fail : failed) {
out << fail << "\n";
}
if (outstring) {
*outstring = out.str();
......@@ -305,8 +302,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::vector<const char*> testCommand;
testCommand.push_back(fullPath.c_str());
for (size_t k = 0; k < this->TestCommandArgs.size(); ++k) {
testCommand.push_back(this->TestCommandArgs[k].c_str());
for (std::string const& testCommandArg : this->TestCommandArgs) {
testCommand.push_back(testCommandArg.c_str());
}
testCommand.push_back(nullptr);
std::string outs;
......@@ -317,8 +314,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
cmSystemTools::ChangeDirectory(this->BuildRunDir);
}
out << "Running test command: \"" << fullPath << "\"";
for (size_t k = 0; k < this->TestCommandArgs.size(); ++k) {
out << " \"" << this->TestCommandArgs[k] << "\"";
for (std::string const& testCommandArg : this->TestCommandArgs) {
out << " \"" << testCommandArg << "\"";
}
out << "\n";
......
......@@ -350,18 +350,16 @@ int cmCTestBuildHandler::ProcessHandler()
this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]);
}
// Pre-compile regular expressions objects for all regular expressions
std::vector<std::string>::iterator it;
// Pre-compile regular expressions objects for all regular expressions
#define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \
regexes.clear(); \
cmCTestOptionalLog(this->CTest, DEBUG, \
this << "Add " #regexes << std::endl, this->Quiet); \
for (it = (strings).begin(); it != (strings).end(); ++it) { \
for (std::string const& s : (strings)) { \
cmCTestOptionalLog(this->CTest, DEBUG, \
"Add " #strings ": " << *it << std::endl, \
this->Quiet); \
(regexes).push_back(it->c_str()); \
"Add " #strings ": " << s << std::endl, this->Quiet); \
(regexes).push_back(s.c_str()); \
}
cmCTestBuildHandlerPopulateRegexVector(this->CustomErrorMatches,
this->ErrorMatchRegex);
......@@ -426,27 +424,24 @@ int cmCTestBuildHandler::ProcessHandler()
double elapsed_build_time = cmSystemTools::GetTime() - elapsed_time_start;
// Cleanups strings in the errors and warnings list.
t_ErrorsAndWarningsVector::iterator evit;
if (!this->SimplifySourceDir.empty()) {
for (evit = this->ErrorsAndWarnings.begin();
evit != this->ErrorsAndWarnings.end(); ++evit) {
cmSystemTools::ReplaceString(evit->Text, this->SimplifySourceDir.c_str(),
for (cmCTestBuildErrorWarning& evit : this->ErrorsAndWarnings) {
cmSystemTools::ReplaceString(evit.Text, this->SimplifySourceDir.c_str(),
"/.../");
cmSystemTools::ReplaceString(evit->PreContext,
cmSystemTools::ReplaceString(evit.PreContext,
this->SimplifySourceDir.c_str(), "/.../");
cmSystemTools::ReplaceString(evit->PostContext,
cmSystemTools::ReplaceString(evit.PostContext,
this->SimplifySourceDir.c_str(), "/.../");
}
}
if (!this->SimplifyBuildDir.empty()) {
for (evit = this->ErrorsAndWarnings.begin();
evit != this->ErrorsAndWarnings.end(); ++evit) {
cmSystemTools::ReplaceString(evit->Text, this->SimplifyBuildDir.c_str(),
for (cmCTestBuildErrorWarning& evit : this->ErrorsAndWarnings) {
cmSystemTools::ReplaceString(evit.Text, this->SimplifyBuildDir.c_str(),
"/.../");
cmSystemTools::ReplaceString(evit->PreContext,
cmSystemTools::ReplaceString(evit.PreContext,
this->SimplifyBuildDir.c_str(), "/.../");
cmSystemTools::ReplaceString(evit->PostContext,
cmSystemTools::ReplaceString(evit.PostContext,
this->SimplifyBuildDir.c_str(), "/.../");
}
}
......@@ -556,9 +551,8 @@ void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)
}
// Copy the fragments into the final XML file.
for (Fragments::const_iterator fi = fragments.begin(); fi != fragments.end();
++fi) {
xml.FragmentFile(fi->c_str());
for (std::string const& f : fragments) {
xml.FragmentFile(f.c_str());
}
}
......@@ -588,12 +582,11 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(cmXMLWriter& xml)
xml.StartElement(cm->Error ? "Error" : "Warning");
xml.Element("BuildLogLine", cm->LogLine);
xml.Element("Text", cm->Text);
std::vector<cmCTestCompileErrorWarningRex>::iterator rit;
for (rit = this->ErrorWarningFileLineRegex.begin();
rit != this->ErrorWarningFileLineRegex.end(); ++rit) {
cmsys::RegularExpression* re = &rit->RegularExpression;
for (cmCTestCompileErrorWarningRex& rit :
this->ErrorWarningFileLineRegex) {
cmsys::RegularExpression* re = &rit.RegularExpression;
if (re->find(cm->Text.c_str())) {
cm->SourceFile = re->match(rit->FileIndex);
cm->SourceFile = re->match(rit.FileIndex);
// At this point we need to make this->SourceFile relative to
// the source root of the project, so cvs links will work
cmSystemTools::ConvertToUnixSlashes(cm->SourceFile);
......@@ -609,7 +602,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(cmXMLWriter& xml)
cm->SourceFile = cmSystemTools::CollapseFullPath(cm->SourceFile);
cmSystemTools::ReplaceString(cm->SourceFile, srcdir.c_str(), "");
}
cm->LineNumber = atoi(re->match(rit->LineIndex).c_str());
cm->LineNumber = atoi(re->match(rit.LineIndex).c_str());
break;
}
}
......@@ -759,9 +752,8 @@ void cmCTestBuildHandler::LaunchHelper::WriteScrapeMatchers(
fname += purpose;
fname += ".txt";
cmGeneratedFileStream fout(fname.c_str());
for (std::vector<std::string>::const_iterator mi = matchers.begin();
mi != matchers.end(); ++mi) {
fout << *mi << "\n";
for (std::string const& m : matchers) {
fout << m << "\n";
}
}
......@@ -777,18 +769,19 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
}
std::vector<const char*> argv;
for (std::vector<std::string>::const_iterator a = args.begin();
a != args.end(); ++a) {
argv.push_back(a->c_str());
for (std::string const& arg : args) {
argv.push_back(arg.c_str());
}
argv.push_back(nullptr);
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:",
this->Quiet);
std::vector<const char*>::iterator ait;
for (ait = argv.begin(); ait != argv.end() && *ait; ++ait) {
for (char const* arg : argv) {
if (!arg) {
break;
}
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" \"" << *ait << "\"", this->Quiet);
" \"" << arg << "\"", this->Quiet);
}
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl,
this->Quiet);
......@@ -1007,10 +1000,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
errorwarning.PostContext = "";
// Copy pre-context to report
std::deque<std::string>::iterator pcit;
for (pcit = this->PreContext.begin(); pcit != this->PreContext.end();
++pcit) {
errorwarning.PreContext += *pcit + "\n";
for (std::string const& pc : this->PreContext) {
errorwarning.PreContext += pc + "\n";
}
this->PreContext.clear();
......@@ -1082,8 +1073,6 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
cmCTestOptionalLog(this->CTest, DEBUG, "Line: [" << data << "]" << std::endl,
this->Quiet);
std::vector<cmsys::RegularExpression>::iterator it;
int warningLine = 0;
int errorLine = 0;
......@@ -1092,9 +1081,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
if (!this->ErrorQuotaReached) {
// Errors
int wrxCnt = 0;
for (it = this->ErrorMatchRegex.begin(); it != this->ErrorMatchRegex.end();
++it) {
if (it->find(data)) {
for (cmsys::RegularExpression& rx : this->ErrorMatchRegex) {
if (rx.find(data)) {
errorLine = 1;
cmCTestOptionalLog(this->CTest, DEBUG,
" Error Line: " << data << " (matches: "
......@@ -1107,9 +1095,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
}
// Error exceptions
wrxCnt = 0;
for (it = this->ErrorExceptionRegex.begin();
it != this->ErrorExceptionRegex.end(); ++it) {
if (it->find(data)) {
for (cmsys::RegularExpression& rx : this->ErrorExceptionRegex) {
if (rx.find(data)) {
errorLine = 0;
cmCTestOptionalLog(this->CTest, DEBUG, " Not an error Line: "
<< data << " (matches: "
......@@ -1124,9 +1111,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
if (!this->WarningQuotaReached) {
// Warnings
int wrxCnt = 0;
for (it = this->WarningMatchRegex.begin();
it != this->WarningMatchRegex.end(); ++it) {
if (it->find(data)) {
for (cmsys::RegularExpression& rx : this->WarningMatchRegex) {
if (rx.find(data)) {
warningLine = 1;
cmCTestOptionalLog(this->CTest, DEBUG, " Warning Line: "
<< data << " (matches: "
......@@ -1140,9 +1126,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
wrxCnt = 0;
// Warning exceptions
for (it = this->WarningExceptionRegex.begin();
it != this->WarningExceptionRegex.end(); ++it) {
if (it->find(data)) {
for (cmsys::RegularExpression& rx : this->WarningExceptionRegex) {
if (rx.find(data)) {
warningLine = 0;
cmCTestOptionalLog(this->CTest, DEBUG, " Not a warning Line: "
<< data << " (matches: "
......
......@@ -92,9 +92,8 @@ bool cmCTestCVS::UpdateImpl()
cvs_update.push_back(this->CommandLineTool.c_str());
cvs_update.push_back("-z3");
cvs_update.push_back("update");
for (std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) {
cvs_update.push_back(ai->c_str());
for (std::string const& arg : args) {
cvs_update.push_back(arg.c_str());
}
cvs_update.push_back(nullptr);
......@@ -242,12 +241,12 @@ void cmCTestCVS::WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
// Load revisions and write an entry for each file in this directory.
std::vector<Revision> revisions;
for (Directory::const_iterator fi = dir.begin(); fi != dir.end(); ++fi) {
std::string full = path + slash + fi->first;
for (auto const& fi : dir) {
std::string full = path + slash + fi.first;
// Load two real or unknown revisions.
revisions.clear();
if (fi->second != PathUpdated) {
if (fi.second != PathUpdated) {
// For local modifications the current rev is unknown and the
// prior rev is the latest from cvs.
revisions.push_back(this->Unknown);
......@@ -256,8 +255,8 @@ void cmCTestCVS::WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
revisions.resize(2, this->Unknown);
// Write the entry for this file with these revisions.
File f(fi->second, &revisions[0], &revisions[1]);
this->WriteXMLEntry(xml, path, fi->first, full, f);
File f(fi.second, &revisions[0], &revisions[1]);
this->WriteXMLEntry(xml, path, fi.first, full, f);
}
xml.EndElement(); // Directory
}
......@@ -269,10 +268,8 @@ bool cmCTestCVS::WriteXMLUpdates(cmXMLWriter& xml)
" "
<< std::flush);
for (std::map<std::string, Directory>::const_iterator di =
this->Dirs.begin();
di != this->Dirs.end(); ++di) {
this->WriteXMLDirectory(xml, di->first, di->second);
for (auto const& d : this->Dirs) {
this->WriteXMLDirectory(xml, d.first, d.second);
}
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl);
......
......@@ -79,11 +79,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmakeConfigureCommand += cmSystemTools::GetCMakeCommand();
cmakeConfigureCommand += "\"";
std::vector<std::string>::const_iterator it;
std::string option;
for (it = options.begin(); it != options.end(); ++it) {
option = *it;
for (std::string const& option : options) {
cmakeConfigureCommand += " \"";
cmakeConfigureCommand += option;
cmakeConfigureCommand += "\"";
......
This diff is collapsed.
......@@ -61,12 +61,11 @@ size_t curlDebugCallback(CURL* /*unused*/, curl_infotype /*unused*/,
void cmCTestCurl::SetCurlOptions(std::vector<std::string> const& args)
{
for (std::vector<std::string>::const_iterator i = args.begin();
i != args.end(); ++i) {
if (*i == "CURLOPT_SSL_VERIFYPEER_OFF") {
for (std::string const& arg : args) {
if (arg == "CURLOPT_SSL_VERIFYPEER_OFF") {
this->VerifyPeerOff = true;
}
if (*i == "CURLOPT_SSL_VERIFYHOST_OFF") {
if (arg == "CURLOPT_SSL_VERIFYHOST_OFF") {
this->VerifyHostOff = true;
}
}
......@@ -146,12 +145,11 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
struct curl_slist* headers =
::curl_slist_append(nullptr, "Content-Type: text/xml");
// Add any additional headers that the user specified.
for (std::vector<std::string>::const_iterator h = this->HttpHeaders.begin();
h != this->HttpHeaders.end(); ++h) {
for (std::string const& h : this->HttpHeaders) {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Add HTTP Header: \"" << *h << "\"" << std::endl,
" Add HTTP Header: \"" << h << "\"" << std::endl,
this->Quiet);
headers = ::curl_slist_append(headers, h->c_str());
headers = ::curl_slist_append(headers, h.c_str());
}
::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, headers);
std::vector<char> responseData;
......@@ -213,13 +211,11 @@ bool cmCTestCurl::HttpRequest(std::string const& url,
// Add headers if any were specified.
struct curl_slist* headers = nullptr;
if (!this->HttpHeaders.empty()) {
for (std::vector<std::string>::const_iterator h =
this->HttpHeaders.begin();
h != this->HttpHeaders.end(); ++h) {
for (std::string const& h : this->HttpHeaders) {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Add HTTP Header: \"" << *h << "\"" << std::endl,
" Add HTTP Header: \"" << h << "\"" << std::endl,
this->Quiet);
headers = ::curl_slist_append(headers, h->c_str());
headers = ::curl_slist_append(headers, h.c_str());
}
}
......
......@@ -163,9 +163,8 @@ bool cmCTestGIT::UpdateByFetchAndReset()
opts = this->CTest->GetCTestConfiguration("GITUpdateOptions");
}
std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
for (std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) {
git_fetch.push_back(ai->c_str());
for (std::string const& arg : args) {
git_fetch.push_back(arg.c_str());
}
// Sentinel argument.
......@@ -215,9 +214,8 @@ bool cmCTestGIT::UpdateByCustom(std::string const& custom)
std::vector<std::string> git_custom_command;
cmSystemTools::ExpandListArgument(custom, git_custom_command, true);
std::vector<char const*> git_custom;
for (std::vector<std::string>::const_iterator i = git_custom_command.begin();
i != git_custom_command.end(); ++i) {
git_custom.push_back(i->c_str());
for (std::string const& i : git_custom_command) {
git_custom.push_back(i.c_str());
}
git_custom.push_back(nullptr);
......@@ -655,9 +653,8 @@ bool cmCTestGIT::LoadModifications()
OutputLogger err(this->Log, "di-err> ");
this->RunChild(git_diff_index, &out, &err, nullptr, cmProcessOutput::UTF8);
for (std::vector<Change>::const_iterator ci = out.Changes.begin();
ci != out.Changes.end(); ++ci) {
this->DoModification(PathModified, ci->Path);
for (Change const& c : out.Changes) {
this->DoModification(PathModified, c.Path);
}
return true;
}
......@@ -57,10 +57,8 @@ void cmCTestGenericHandler::Initialize()
this->AppendXML = false;
this->TestLoad = 0;
this->Options.clear();
t_StringToString::iterator it;
for (it = this->PersistentOptions.begin();
it != this->PersistentOptions.end(); ++it) {
this->Options[it->first] = it->second;
for (auto const& po : this->PersistentOptions) {
this->Options[po.first] = po.second;
}
}
......
......@@ -48,15 +48,14 @@ void cmCTestGlobalVC::DoRevision(Revision const& revision,
/* clang-format on */
// Update information about revisions of the changed files.
for (std::vector<Change>::const_iterator ci = changes.begin();
ci != changes.end(); ++ci) {
if (const char* local = this->LocalPath(ci->Path)) {
for (Change const& c : changes) {
if (const char* local = this->LocalPath(c.Path)) {
std::string dir = cmSystemTools::GetFilenamePath(local);
std::string name = cmSystemTools::GetFilenameName(local);
File& file = this->Dirs[dir][name];
file.PriorRev = file.Rev ? file.Rev : &this->PriorRev;
file.Rev = &rev;
this->Log << " " << ci->Action << " " << local << " "
this->Log << " " << c.Action << " " << local << " "
<< "\n";
}
}
......@@ -83,9 +82,9 @@ void cmCTestGlobalVC::WriteXMLDirectory(cmXMLWriter& xml,
const char* slash = path.empty() ? "" : "/";
xml.StartElement("Directory");
xml.Element("Name", path);
for (Directory::const_iterator fi = dir.begin(); fi != dir.end(); ++fi) {
std::string full = path + slash + fi->first;
this->WriteXMLEntry(xml, path, fi->first, full, fi->second);
for (auto const& f : dir) {
std::string const full = path + slash + f.first;
this->WriteXMLEntry(xml, path, f.first, full, f.second);
}
xml.EndElement(); // Directory
}
......@@ -114,10 +113,8 @@ bool cmCTestGlobalVC::WriteXMLUpdates(cmXMLWriter& xml)
this->WriteXMLGlobal(xml);
for (std::map<std::string, Directory>::const_iterator di =
this->Dirs.begin();
di != this->Dirs.end(); ++di) {
this->WriteXMLDirectory(xml, di->first, di->second);
for (auto const& d : this->Dirs) {
this->WriteXMLDirectory(xml, d.first, d.second);
}
return result;
......
......@@ -145,9 +145,8 @@ bool cmCTestHG::UpdateImpl()
opts = this->CTest->GetCTestConfiguration("HGUpdateOptions");
}
std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
for (std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) {
hg_update.push_back(ai->c_str());
for (std::string const& arg : args) {
hg_update.push_back(arg.c_str());
}
// Sentinel argument.
......@@ -217,25 +216,25 @@ private:
this->Rev.Log.assign(&this->CData[0], this->CData.size());
} else if (!this->CData.empty() && name == "files") {
std::vector<std::string> paths = this->SplitCData();
for (unsigned int i = 0; i < paths.size(); ++i) {
for (std::string const& path : paths) {
// Updated by default, will be modified using file_adds and
// file_dels.
this->CurChange = Change('U');
this->CurChange.Path = paths[i];
this->CurChange.Path = path;
this->Changes.push_back(this->CurChange);
}
} else if (!this->CData.empty() && name == "file_adds") {
std::string added_paths(this->CData.begin(), this->CData.end());
for (unsigned int i = 0; i < this->Changes.size(); ++i) {
if (added_paths.find(this->Changes[i].Path) != std::string::npos) {
this->Changes[i].Action = 'A';
for (Change& change : this->Changes) {
if (added_paths.find(change.Path) != std::string::npos) {
change.Action = 'A';
}
}
} else if (!this->CData.empty() && name == "file_dels") {
std::string added_paths(this->CData.begin(), this->CData.end());
for (unsigned int i = 0; i < this->Changes.size(); ++i) {
if (added_paths.find(this->Changes[i].Path) != std::string::npos) {
this->Changes[i].Action = 'D';
for (Change& change : this->Changes) {
if (added_paths.find(change.Path) != std::string::npos) {
change.Action = 'D';
}
}
}
......@@ -246,9 +245,9 @@ private:
{
std::vector<std::string> output;
std::string currPath;
for (unsigned int i = 0; i < this->CData.size();