summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-24 17:07:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:58:09 (GMT)
commit7c3f637680ac0cdb6cec5e75ba4a9b188de5017b (patch)
tree4a714dc5d1440b87fc5b28214c14795319eef0a3
parent8a399c8c9f1c4a793289d6baf37081efac082eee (diff)
downloadCMake-7c3f637680ac0cdb6cec5e75ba4a9b188de5017b.zip
CMake-7c3f637680ac0cdb6cec5e75ba4a9b188de5017b.tar.gz
CMake-7c3f637680ac0cdb6cec5e75ba4a9b188de5017b.tar.bz2
Convert loop into two algorithms.
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 359141a..a08c159 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2299,16 +2299,12 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
{
// Now add the rest of the components separated by the proper slash
// direction for this platform.
- const char* sep = "";
- for(unsigned int i=1; i < components.size() - 1; ++i)
- {
- if(!components[i].empty())
- {
- result += sep;
- result += components[i];
- sep = slash;
- }
- }
+ std::vector<std::string>::const_iterator compEnd
+ = std::remove(components.begin() + 1, components.end() - 1,
+ std::string());
+ std::vector<std::string>::const_iterator compStart
+ = components.begin() + 1;
+ result += cmJoin(cmRange(compStart, compEnd), slash);
// Only the last component can be empty to avoid double slashes.
result += slash;
result += components.back();