summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePathCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-06-16 18:47:40 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-05 20:34:57 (GMT)
commit1ee5a4a548c62e5c382f3497be82aac36a99e485 (patch)
tree5a95ec119c06a3cac5c83edb5bc4548d929c89e6 /Source/cmCMakePathCommand.cxx
parentfd3ed41109db9682bbdcb5e5d3249b6654322ca6 (diff)
downloadCMake-1ee5a4a548c62e5c382f3497be82aac36a99e485.zip
CMake-1ee5a4a548c62e5c382f3497be82aac36a99e485.tar.gz
CMake-1ee5a4a548c62e5c382f3497be82aac36a99e485.tar.bz2
cmArgumentParser: Avoid allocating copies of keyword strings
Diffstat (limited to 'Source/cmCMakePathCommand.cxx')
-rw-r--r--Source/cmCMakePathCommand.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmCMakePathCommand.cxx b/Source/cmCMakePathCommand.cxx
index bf94c2d..adcffa9 100644
--- a/Source/cmCMakePathCommand.cxx
+++ b/Source/cmCMakePathCommand.cxx
@@ -44,8 +44,8 @@ public:
template <int Advance = 2>
Result Parse(std::vector<std::string> const& args,
- std::vector<std::string>* keywordsMissingValue = nullptr,
- std::vector<std::string>* parsedKeywords = nullptr) const
+ std::vector<cm::string_view>* keywordsMissingValue = nullptr,
+ std::vector<cm::string_view>* parsedKeywords = nullptr) const
{
this->Inputs.clear();
@@ -89,11 +89,11 @@ public:
args, &this->KeywordsMissingValue, &this->ParsedKeywords);
}
- const std::vector<std::string>& GetKeywordsMissingValue() const
+ const std::vector<cm::string_view>& GetKeywordsMissingValue() const
{
return this->KeywordsMissingValue;
}
- const std::vector<std::string>& GetParsedKeywords() const
+ const std::vector<cm::string_view>& GetParsedKeywords() const
{
return this->ParsedKeywords;
}
@@ -121,8 +121,8 @@ public:
}
private:
- mutable std::vector<std::string> KeywordsMissingValue;
- mutable std::vector<std::string> ParsedKeywords;
+ mutable std::vector<cm::string_view> KeywordsMissingValue;
+ mutable std::vector<cm::string_view> ParsedKeywords;
};
struct OutputVariable