summaryrefslogtreecommitdiffstats
path: root/Source/cmConditionEvaluator.cxx
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2020-03-20 16:04:40 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2020-03-23 19:19:26 (GMT)
commitbfb69f9543bfa7f9f3c9488bf7e740f21896cec4 (patch)
tree866c20d05a20fae42cf06ef848796ba621d643f2 /Source/cmConditionEvaluator.cxx
parent7df84ffe58572a4535b08bc7b76148a60d38fbb4 (diff)
downloadCMake-bfb69f9543bfa7f9f3c9488bf7e740f21896cec4.zip
CMake-bfb69f9543bfa7f9f3c9488bf7e740f21896cec4.tar.gz
CMake-bfb69f9543bfa7f9f3c9488bf7e740f21896cec4.tar.bz2
replace "substr(0, xx) ==" with cmHasPrefix()
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r--Source/cmConditionEvaluator.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index fda687f..bf11022 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -494,12 +494,12 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
if (this->IsKeyword(keyDEFINED, *arg) && argP1 != newArgs.end()) {
size_t argP1len = argP1->GetValue().size();
bool bdef = false;
- if (argP1len > 4 && argP1->GetValue().substr(0, 4) == "ENV{" &&
+ if (argP1len > 4 && cmHasLiteralPrefix(argP1->GetValue(), "ENV{") &&
argP1->GetValue().operator[](argP1len - 1) == '}') {
std::string env = argP1->GetValue().substr(4, argP1len - 5);
bdef = cmSystemTools::HasEnv(env);
} else if (argP1len > 6 &&
- argP1->GetValue().substr(0, 6) == "CACHE{" &&
+ cmHasLiteralPrefix(argP1->GetValue(), "CACHE{") &&
argP1->GetValue().operator[](argP1len - 1) == '}') {
std::string cache = argP1->GetValue().substr(6, argP1len - 7);
bdef =