summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-01-11 13:05:41 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-01-12 23:00:43 (GMT)
commit95e4cfc5947fb5a324f6dad50cff8d71f928aba8 (patch)
treefef2404953122afa160668b23273fe6de2ad5b9b /Source/cmQtAutoGenerators.cxx
parent6c55755bdd54c2d474e2c8fe4c9d078e10404f26 (diff)
downloadCMake-95e4cfc5947fb5a324f6dad50cff8d71f928aba8.zip
CMake-95e4cfc5947fb5a324f6dad50cff8d71f928aba8.tar.gz
CMake-95e4cfc5947fb5a324f6dad50cff8d71f928aba8.tar.bz2
Autogen: Generators: Simplify (and fix) JoinExts function
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 73afdc1..f3fa047 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -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;
}