diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-03-10 12:13:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-03-10 18:25:36 (GMT) |
commit | db17de24385283b8c29493b87a280f65157345d9 (patch) | |
tree | 73cb79e7a79a26b5e7c8da5c0abf8be867d1d775 /Source/cmGlobalGhsMultiGenerator.cxx | |
parent | efa30023b4056a4c17e80d7a86bc2506660c68a7 (diff) | |
download | CMake-db17de24385283b8c29493b87a280f65157345d9.zip CMake-db17de24385283b8c29493b87a280f65157345d9.tar.gz CMake-db17de24385283b8c29493b87a280f65157345d9.tar.bz2 |
GHS: Use cm::erase in place of loop
Diffstat (limited to 'Source/cmGlobalGhsMultiGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGhsMultiGenerator.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index bb9dd37..78e3b43 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -9,6 +9,7 @@ #include <utility> #include <cm/memory> +#include <cm/string> #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" @@ -651,21 +652,16 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives( char const* const customization = this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION"); if (nullptr != customization && strlen(customization) > 0) { - fout << "customization=" << this->TrimQuotes(customization) << std::endl; + fout << "customization=" + << cmGlobalGhsMultiGenerator::TrimQuotes(customization) << std::endl; this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION"); } } -std::string cmGlobalGhsMultiGenerator::TrimQuotes(std::string const& str) +std::string cmGlobalGhsMultiGenerator::TrimQuotes(std::string str) { - std::string result; - result.reserve(str.size()); - for (const char* ch = str.c_str(); *ch != '\0'; ++ch) { - if (*ch != '"') { - result += *ch; - } - } - return result; + cm::erase(str, '"'); + return str; } bool cmGlobalGhsMultiGenerator::TargetCompare::operator()( |