summaryrefslogtreecommitdiffstats
path: root/Source/cmGetCMakePropertyCommand.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/cmGetCMakePropertyCommand.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/cmGetCMakePropertyCommand.cxx')
-rw-r--r--Source/cmGetCMakePropertyCommand.cxx23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index e193cf5..c0e4683 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -25,7 +25,6 @@ bool cmGetCMakePropertyCommand
return false;
}
- std::vector<std::string>::size_type cc;
std::string variable = args[0];
std::string output = "NOTFOUND";
@@ -35,12 +34,15 @@ bool cmGetCMakePropertyCommand
std::vector<std::string> vars = this->Makefile->GetDefinitions(cacheonly);
if (!vars.empty())
{
- output = vars[0];
- }
- for ( cc = 1; cc < vars.size(); ++cc )
- {
- output += ";";
- output += vars[cc];
+ output = "";
+ const char* sep = "";
+ std::vector<std::string>::size_type cc;
+ for ( cc = 0; cc < vars.size(); ++cc )
+ {
+ output += sep;
+ output += vars[cc];
+ sep = ";";
+ }
}
}
else if ( args[1] == "MACROS" )
@@ -54,13 +56,12 @@ bool cmGetCMakePropertyCommand
->GetInstallComponents();
std::set<std::string>::const_iterator compIt;
output = "";
+ const char* sep = "";
for (compIt = components->begin(); compIt != components->end(); ++compIt)
{
- if (compIt != components->begin())
- {
- output += ";";
- }
+ output += sep;
output += *compIt;
+ sep = ";";
}
}
else