summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-14 20:31:46 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:57:55 (GMT)
commit8910224950a2b723e0d4fd7c21a326af7fb2e050 (patch)
tree09eb05962917fc5f205db31ae06b8c105813617e /Source/cmMakefile.cxx
parent7b8725bf8472ebf4781ddd60ef8fcca9c3ad98dd (diff)
downloadCMake-8910224950a2b723e0d4fd7c21a326af7fb2e050.zip
CMake-8910224950a2b723e0d4fd7c21a326af7fb2e050.tar.gz
CMake-8910224950a2b723e0d4fd7c21a326af7fb2e050.tar.bz2
Replace common loop pattern with cmJoin
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx30
1 files changed, 3 insertions, 27 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index aca4413..ac5fec9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4202,15 +4202,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
}
else if (prop == "LISTFILE_STACK")
{
- const char* sep = "";
- for (std::deque<std::string>::const_iterator
- i = this->ListFileStack.begin();
- i != this->ListFileStack.end(); ++i)
- {
- output += sep;
- output += *i;
- sep = ";";
- }
+ output = cmJoin(this->ListFileStack, ";");
return output.c_str();
}
else if (prop == "VARIABLES" || prop == "CACHE_VARIABLES")
@@ -4220,14 +4212,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
{
cacheonly = 1;
}
- std::vector<std::string> vars = this->GetDefinitions(cacheonly);
- const char* sep = "";
- for (unsigned int cc = 0; cc < vars.size(); cc ++ )
- {
- output += sep;
- output += vars[cc];
- sep = ";";
- }
+ output = cmJoin(this->GetDefinitions(cacheonly), ";");
return output.c_str();
}
else if (prop == "MACROS")
@@ -4242,16 +4227,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
}
else if (prop == "LINK_DIRECTORIES")
{
- const char* sep = "";
- for (std::vector<std::string>::const_iterator
- it = this->GetLinkDirectories().begin();
- it != this->GetLinkDirectories().end();
- ++ it )
- {
- output += sep;
- output += *it;
- sep = ";";
- }
+ output = cmJoin(this->GetLinkDirectories(), ";");
return output.c_str();
}
else if (prop == "INCLUDE_DIRECTORIES")