mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
cmGeneratorExpression: Change Find() parameter type to cm::string_view
This commit is contained in:
@@ -375,14 +375,15 @@ std::string cmGeneratorExpression::Preprocess(const std::string& input,
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string::size_type cmGeneratorExpression::Find(const std::string& input)
|
||||
cm::string_view::size_type cmGeneratorExpression::Find(
|
||||
const cm::string_view& input)
|
||||
{
|
||||
const std::string::size_type openpos = input.find("$<");
|
||||
if (openpos != std::string::npos &&
|
||||
input.find('>', openpos) != std::string::npos) {
|
||||
const cm::string_view::size_type openpos = input.find("$<");
|
||||
if (openpos != cm::string_view::npos &&
|
||||
input.find('>', openpos) != cm::string_view::npos) {
|
||||
return openpos;
|
||||
}
|
||||
return std::string::npos;
|
||||
return cm::string_view::npos;
|
||||
}
|
||||
|
||||
bool cmGeneratorExpression::IsValidTargetName(const std::string& input)
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
static void Split(const std::string& input,
|
||||
std::vector<std::string>& output);
|
||||
|
||||
static std::string::size_type Find(const std::string& input);
|
||||
static cm::string_view::size_type Find(const cm::string_view& input);
|
||||
|
||||
static bool IsValidTargetName(const std::string& input);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user