summaryrefslogtreecommitdiff
path: root/Source/cmConditionEvaluator.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-16 22:45:24 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-16 22:45:24 +0200
commit516f8edb2e061749c56b6f9a58332fbf59e45a1a (patch)
tree82ebe3f38b5248ef0b78586019ac1dca44ce2370 /Source/cmConditionEvaluator.cxx
parentd9f5d3c50fe376423382d6445f7fb2906a43469e (diff)
downloadcmake-516f8edb2e061749c56b6f9a58332fbf59e45a1a.tar.gz
Avoid else after return
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r--Source/cmConditionEvaluator.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index e670dc6fdd..f78e8409a5 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -249,20 +249,19 @@ bool cmConditionEvaluator::GetBooleanValueOld(
// Old IsTrue behavior for single argument.
if (arg == "0") {
return false;
- } else if (arg == "1") {
+ }
+ if (arg == "1") {
return true;
- } else {
- const char* def = this->GetDefinitionIfUnquoted(arg);
- return !cmSystemTools::IsOff(def);
}
- } else {
- // Old GetVariableOrNumber behavior.
const char* def = this->GetDefinitionIfUnquoted(arg);
- if (!def && atoi(arg.c_str())) {
- def = arg.c_str();
- }
return !cmSystemTools::IsOff(def);
}
+ // Old GetVariableOrNumber behavior.
+ const char* def = this->GetDefinitionIfUnquoted(arg);
+ if (!def && atoi(arg.c_str())) {
+ def = arg.c_str();
+ }
+ return !cmSystemTools::IsOff(def);
}
//=========================================================================
@@ -274,7 +273,8 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
// Use the policy if it is set.
if (this->Policy12Status == cmPolicies::NEW) {
return GetBooleanValue(newArg);
- } else if (this->Policy12Status == cmPolicies::OLD) {
+ }
+ if (this->Policy12Status == cmPolicies::OLD) {
return GetBooleanValueOld(newArg, oneArg);
}