Merge topic 'use-cmRange'

7c3f6376 Convert loop into two algorithms.
8a399c8c Convert loop to the common pattern.
abfca975 Move loop inside of condition.
0b61b86d Handle last element outside of the loop.
e21f7829 cmTarget: Use a sorted vector in place of a set.
559dc155 cmSet: Replace loop with cmJoin.
0ea71932 cmFindBase: Replace loop with cmJoin on range.
9380e85f Convert loops to cmJoin algorithm with cmRange.
bb10012f cmStringCommand: Accumulate with cmJoin and range adaptors.
0c12f1ea cmAlgorithms: Add a range adaptor and API for adjusting a range.
27c6f017 Use cmJoin to accumulate string ranges.
4e78ebbd cmAlgorithms: Add a Range container and adaptor method.
89102249 Replace common loop pattern with cmJoin
7b8725bf Convert loops populating maybe-empty content into the common pattern.
7ee56f03 Convert loops into the commonly used pattern.
0a4e5674 cmMacroCommand: Remove counting variable.
...
This commit is contained in:
Brad King
2015-02-12 11:53:04 -05:00
committed by CMake Topic Stage
27 changed files with 274 additions and 350 deletions

View File

@@ -2295,21 +2295,19 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
// Begin the quoted result with the root component.
result += components[0];
// Now add the rest of the components separated by the proper slash
// direction for this platform.
bool first = true;
for(unsigned int i=1; i < components.size(); ++i)
if (components.size() > 1)
{
// Now add the rest of the components separated by the proper slash
// direction for this platform.
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.
if(!components[i].empty() || (i == (components.size()-1)))
{
if(!first)
{
result += slash;
}
result += components[i];
first = false;
}
result += slash;
result += components.back();
}
}