summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-17 16:47:10 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:57:41 (GMT)
commit7ee56f03999e8605cc2cbe85a3a7b7159e639e5d (patch)
tree8432f325d70284b0508ea7ec6133e247c15448ec /Source/cmMakefile.cxx
parent0a4e5674eccb0126733086d4632c7239217db6f1 (diff)
downloadCMake-7ee56f03999e8605cc2cbe85a3a7b7159e639e5d.zip
CMake-7ee56f03999e8605cc2cbe85a3a7b7159e639e5d.tar.gz
CMake-7ee56f03999e8605cc2cbe85a3a7b7159e639e5d.tar.bz2
Convert loops into the commonly used pattern.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx34
1 files changed, 13 insertions, 21 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index eb68e49..aca4413 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3752,15 +3752,12 @@ void cmMakefile::GetListOfMacros(std::string& macros) const
{
StringStringMap::const_iterator it;
macros = "";
- int cc = 0;
+ const char* sep = "";
for ( it = this->MacrosMap.begin(); it != this->MacrosMap.end(); ++it )
{
- if ( cc > 0 )
- {
- macros += ";";
- }
+ macros += sep;
macros += it->first;
- cc ++;
+ sep = "";
}
}
@@ -4205,15 +4202,14 @@ 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)
{
- if (i != this->ListFileStack.begin())
- {
- output += ";";
- }
+ output += sep;
output += *i;
+ sep = ";";
}
return output.c_str();
}
@@ -4225,13 +4221,12 @@ 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 ++ )
{
- if ( cc > 0 )
- {
- output += ";";
- }
+ output += sep;
output += vars[cc];
+ sep = ";";
}
return output.c_str();
}
@@ -4247,19 +4242,16 @@ const char *cmMakefile::GetProperty(const std::string& prop,
}
else if (prop == "LINK_DIRECTORIES")
{
- std::ostringstream str;
+ const char* sep = "";
for (std::vector<std::string>::const_iterator
it = this->GetLinkDirectories().begin();
it != this->GetLinkDirectories().end();
++ it )
{
- if ( it != this->GetLinkDirectories().begin())
- {
- str << ";";
- }
- str << it->c_str();
+ output += sep;
+ output += *it;
+ sep = ";";
}
- output = str.str();
return output.c_str();
}
else if (prop == "INCLUDE_DIRECTORIES")