summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-23 00:06:40 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:58:09 (GMT)
commit8a399c8c9f1c4a793289d6baf37081efac082eee (patch)
treeba3198cfc88e026d9387cc3c91e71125202b0f36 /Source/cmLocalUnixMakefileGenerator3.cxx
parentabfca97525be06e067981b6c6bf63ba7a3aa52f9 (diff)
downloadCMake-8a399c8c9f1c4a793289d6baf37081efac082eee.zip
CMake-8a399c8c9f1c4a793289d6baf37081efac082eee.tar.gz
CMake-8a399c8c9f1c4a793289d6baf37081efac082eee.tar.bz2
Convert loop to the common pattern.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 703ab27..359141a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2299,24 +2299,18 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
{
// Now add the rest of the components separated by the proper slash
// direction for this platform.
- bool first = true;
+ const char* sep = "";
for(unsigned int i=1; i < components.size() - 1; ++i)
{
if(!components[i].empty())
{
- if(!first)
- {
- result += slash;
- }
+ result += sep;
result += components[i];
- first = false;
+ sep = slash;
}
}
// Only the last component can be empty to avoid double slashes.
- if(!first)
- {
- result += slash;
- }
+ result += slash;
result += components.back();
}
}