summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2018-01-24 12:57:57 (GMT)
committerBrad King <brad.king@kitware.com>2018-01-31 16:04:36 (GMT)
commit901c4a1e05ae7d01dcf4208dfd1b11e1534d4895 (patch)
treedab75963a71f1fa58696582756e558b5803082b5 /Source
parent88ed556d99068a5e1bf303e69a156a25fb985bcf (diff)
downloadCMake-901c4a1e05ae7d01dcf4208dfd1b11e1534d4895.zip
CMake-901c4a1e05ae7d01dcf4208dfd1b11e1534d4895.tar.gz
CMake-901c4a1e05ae7d01dcf4208dfd1b11e1534d4895.tar.bz2
cmExpandedCommandArgument: add an overload for const char*
Static string comparisons were causing heap allocations just for a comparison.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExpandedCommandArgument.cxx5
-rw-r--r--Source/cmExpandedCommandArgument.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmExpandedCommandArgument.cxx b/Source/cmExpandedCommandArgument.cxx
index 0bea65f..1c0a721 100644
--- a/Source/cmExpandedCommandArgument.cxx
+++ b/Source/cmExpandedCommandArgument.cxx
@@ -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;
diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h
index fe86528..302e8db 100644
--- a/Source/cmExpandedCommandArgument.h
+++ b/Source/cmExpandedCommandArgument.h
@@ -24,6 +24,7 @@ public:
bool WasQuoted() const;
+ bool operator==(const char* value) const;
bool operator==(std::string const& value) const;
bool empty() const;