From e3c1dbe18b41752f9e042c6a42170887af6af651 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Mon, 26 Jul 2021 05:08:20 +0300 Subject: Refactor: Replace `if` block w/ boolean expression Signed-off-by: Alex Turbov --- Source/cmConditionEvaluator.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 5d8dc70..3673200 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -657,16 +657,12 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, if (this->Policy57Status != cmPolicies::OLD && this->Policy57Status != cmPolicies::WARN) { - auto result = false; def = this->GetVariableOrString(*arg); def2 = this->Makefile.GetDefinition(argP2->GetValue()); - if (def2) { - result = cm::contains(cmExpandedList(*def2, true), *def); - } - - HandleBinaryOp(result, arg, newArgs, argP1, argP2); + HandleBinaryOp(def2 && cm::contains(cmExpandedList(*def2, true), *def), + arg, newArgs, argP1, argP2); } else if (this->Policy57Status == cmPolicies::WARN) { std::ostringstream e; e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0057) -- cgit v0.12