diff options
author | Brad King <brad.king@kitware.com> | 2023-07-11 16:12:19 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-07-11 16:12:35 (GMT) |
commit | 7ad290bf9c3f0d262cc2ef6ee141de88605e7af9 (patch) | |
tree | 5577faba5c9f4ec365a06f1bac3385c12d254e4c /Source | |
parent | 7202366638ecdaf0abd272907f58ccd4d32c510e (diff) | |
parent | a6e8811cf0d0b9dbb09c984d427e651eb29d9faf (diff) | |
download | CMake-7ad290bf9c3f0d262cc2ef6ee141de88605e7af9.zip CMake-7ad290bf9c3f0d262cc2ef6ee141de88605e7af9.tar.gz CMake-7ad290bf9c3f0d262cc2ef6ee141de88605e7af9.tar.bz2 |
Merge topic 'cmList-regression'
a6e8811cf0 cmList: Fix performance regression in Join / to_string
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8612
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmList.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmList.h b/Source/cmList.h index 9ee4a46..dc5850a 100644 --- a/Source/cmList.h +++ b/Source/cmList.h @@ -1211,13 +1211,12 @@ private: const auto sep = std::string{ glue }; - return std::accumulate( - std::next(std::begin(r)), std::end(r), cmList::ToString(*std::begin(r)), - [&sep](std::string const& a, - typename std::iterator_traits<decltype(std::begin( - r))>::value_type const& b) -> std::string { - return a + sep + cmList::ToString(b); - }); + std::string joined = cmList::ToString(*std::begin(r)); + for (auto it = std::next(std::begin(r)); it != std::end(r); ++it) { + joined += sep + cmList::ToString(*it); + } + + return joined; } container_type Values; |