diff options
Diffstat (limited to 'Source/cmForEachCommand.cxx')
-rw-r--r-- | Source/cmForEachCommand.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 32e7892..3b82e0a 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -113,8 +113,8 @@ bool cmForEachFunctionBlocker::ReplayItems( // At end of for each execute recorded commands // store the old value std::string oldDef; - if (mf.GetDefinition(this->Args.front())) { - oldDef = mf.GetDefinition(this->Args.front()); + if (auto d = mf.GetDefinition(this->Args.front())) { + oldDef = d; } auto restore = false; @@ -186,8 +186,8 @@ bool cmForEachFunctionBlocker::ReplayZipLists( // Store old values for iteration variables std::map<std::string, std::string> oldDefs; for (auto i = 0u; i < values.size(); ++i) { - if (mf.GetDefinition(iterationVars[i])) { - oldDefs.emplace(iterationVars[i], mf.GetDefinition(iterationVars[i])); + if (auto d = mf.GetDefinition(iterationVars[i])) { + oldDefs.emplace(iterationVars[i], d); } } |