mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
Refactor: Get rid of isTrue variable in the while block execution
This commit is contained in:
@@ -81,12 +81,10 @@ bool cmWhileFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
|
|||||||
|
|
||||||
std::string errorString;
|
std::string errorString;
|
||||||
MessageType messageType;
|
MessageType messageType;
|
||||||
auto isTrue = true;
|
|
||||||
|
|
||||||
for (cmConditionEvaluator conditionEvaluator(mf, whileBT);
|
for (cmConditionEvaluator conditionEvaluator(mf, whileBT);
|
||||||
(isTrue =
|
conditionEvaluator.IsTrue(expandArgs(this->Args, expandedArguments),
|
||||||
conditionEvaluator.IsTrue(expandArgs(this->Args, expandedArguments),
|
errorString, messageType);) {
|
||||||
errorString, messageType));) {
|
|
||||||
// Invoke all the functions that were collected in the block.
|
// Invoke all the functions that were collected in the block.
|
||||||
for (cmListFileFunction const& fn : functions) {
|
for (cmListFileFunction const& fn : functions) {
|
||||||
cmExecutionStatus status(mf);
|
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 ";
|
std::string err = "had incorrect arguments:\n ";
|
||||||
for (auto const& i : expandedArguments) {
|
for (auto const& i : expandedArguments) {
|
||||||
err += " ";
|
err += " ";
|
||||||
|
|||||||
Reference in New Issue
Block a user