cmExpandedCommandArgument: add an overload for const char*

Static string comparisons were causing heap allocations just for a
comparison.
This commit is contained in:
Ben Boeckel authored and Brad King committed 2018-01-31 11:04:36 -05:00
1 parent 88ed556d99
commit 901c4a1e05
2 files changed
+6

No files matched your search

+5
View File
@@ -24,6 +24,11 @@ bool cmExpandedCommandArgument::WasQuoted() const
return this->Quoted;
}
bool cmExpandedCommandArgument::operator==(const char* value) const
{
return this->Value == value;
}
bool cmExpandedCommandArgument::operator==(std::string const& value) const
{
return this->Value == value;
+1
View File
@@ -24,6 +24,7 @@ public:
bool WasQuoted() const;
bool operator==(const char* value) const;
bool operator==(std::string const& value) const;
bool empty() const;