From eae125ace54bd82ed5be14cfee50f41a07b10619 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Tue, 10 Aug 2021 01:19:56 +0300 Subject: Refactor: Get rid of `isTrue` variable in the `while` block execution --- Source/cmWhileCommand.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 7d9eec0..b8297ce 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -81,12 +81,10 @@ bool cmWhileFunctionBlocker::Replay(std::vector functions, std::string errorString; MessageType messageType; - auto isTrue = true; for (cmConditionEvaluator conditionEvaluator(mf, whileBT); - (isTrue = - conditionEvaluator.IsTrue(expandArgs(this->Args, expandedArguments), - errorString, messageType));) { + conditionEvaluator.IsTrue(expandArgs(this->Args, expandedArguments), + errorString, messageType);) { // Invoke all the functions that were collected in the block. for (cmListFileFunction const& fn : functions) { cmExecutionStatus status(mf); @@ -107,7 +105,7 @@ bool cmWhileFunctionBlocker::Replay(std::vector functions, } } - if (!isTrue && !errorString.empty()) { + if (!errorString.empty()) { std::string err = "had incorrect arguments:\n "; for (auto const& i : expandedArguments) { err += " "; -- cgit v0.12