diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2021-08-09 22:19:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-08-11 12:57:45 (GMT) |
commit | eae125ace54bd82ed5be14cfee50f41a07b10619 (patch) | |
tree | 032746c1dda2b3cdfdb4304ed9539276cbe316a8 /Source/cmWhileCommand.cxx | |
parent | 4c1cdfd8f09182d8a6c87772b7fc0946c691e18b (diff) | |
download | CMake-eae125ace54bd82ed5be14cfee50f41a07b10619.zip CMake-eae125ace54bd82ed5be14cfee50f41a07b10619.tar.gz CMake-eae125ace54bd82ed5be14cfee50f41a07b10619.tar.bz2 |
Refactor: Get rid of `isTrue` variable in the `while` block execution
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r-- | Source/cmWhileCommand.cxx | 8 |
1 files 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<cmListFileFunction> 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<cmListFileFunction> functions, } } - if (!isTrue && !errorString.empty()) { + if (!errorString.empty()) { std::string err = "had incorrect arguments:\n "; for (auto const& i : expandedArguments) { err += " "; |