summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2018-01-10 19:01:49 -0500
committerVitaly Stakhovsky <vvs31415@gitlab.org>2018-01-10 19:01:49 -0500
commit969c1f94aed7abbc71dc73b442817fe86a43b4df (patch)
tree2cbd35560536950b8a82518a16c2cf43096f3a13 /Source/cmMakefile.cxx
parentddc4f9a3c05fa24240fde1ba6c0ab28b7d2e91ea (diff)
downloadcmake-969c1f94aed7abbc71dc73b442817fe86a43b4df.tar.gz
cmSourceGroup: code improvements; use std::string and C++11 loops
Topic-rename: cmSourceGroup-modern-cxx
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d069a5c935..1a728c2703 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1961,7 +1961,7 @@ cmSourceGroup* cmMakefile::GetSourceGroup(
if (sg != nullptr) {
// iterate through its children to find match source group
for (unsigned int i = 1; i < name.size(); ++i) {
- sg = sg->LookupChild(name[i].c_str());
+ sg = sg->LookupChild(name[i]);
if (sg == nullptr) {
break;
}
@@ -2005,7 +2005,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
if (i == -1) {
// group does not exist nor belong to any existing group
// add its first component
- this->SourceGroups.push_back(cmSourceGroup(name[0].c_str(), regex));
+ this->SourceGroups.push_back(cmSourceGroup(name[0], regex));
sg = this->GetSourceGroup(currentName);
i = 0; // last component found
}
@@ -2015,9 +2015,8 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
}
// build the whole source group path
for (++i; i <= lastElement; ++i) {
- sg->AddChild(
- cmSourceGroup(name[i].c_str(), nullptr, sg->GetFullName().c_str()));
- sg = sg->LookupChild(name[i].c_str());
+ sg->AddChild(cmSourceGroup(name[i], nullptr, sg->GetFullName().c_str()));
+ sg = sg->LookupChild(name[i]);
}
sg->SetGroupRegex(regex);