mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03: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