mirror of
https://github.com/reactos/CMake.git
synced 2025-02-18 18:49:34 +00:00
GHS: Use cm::erase in place of loop
This commit is contained in:
parent
efa30023b4
commit
db17de2438
@ -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()(
|
||||
|
@ -111,7 +111,7 @@ private:
|
||||
std::vector<cmLocalGenerator*>& generators,
|
||||
std::string& all_target);
|
||||
|
||||
std::string TrimQuotes(std::string const& str);
|
||||
static std::string TrimQuotes(std::string str);
|
||||
|
||||
std::string OsDir;
|
||||
static const char* DEFAULT_BUILD_PROGRAM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user