mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 03:39:43 -06:00
Autogen: Generators: Simplify (and fix) JoinExts function
This commit is contained in:
@@ -99,20 +99,18 @@ static bool ListContains(const std::vector<std::string>& list,
|
||||
|
||||
static std::string JoinExts(const std::vector<std::string>& lst)
|
||||
{
|
||||
if (lst.empty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string result;
|
||||
std::string separator = ",";
|
||||
for (std::vector<std::string>::const_iterator it = lst.begin();
|
||||
it != lst.end(); ++it) {
|
||||
if (it != lst.begin()) {
|
||||
result += separator;
|
||||
if (!lst.empty()) {
|
||||
const std::string separator = ",";
|
||||
for (std::vector<std::string>::const_iterator it = lst.begin();
|
||||
it != lst.end(); ++it) {
|
||||
if (it != lst.begin()) {
|
||||
result += separator;
|
||||
}
|
||||
result += '.';
|
||||
result += *it;
|
||||
}
|
||||
result += '.' + (*it);
|
||||
}
|
||||
result.erase(result.end() - 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user