mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 21:58:50 -05:00
cmMakefile::FormatListFileStack: Refactor 'while' into 'for'
This commit is contained in:
@@ -4256,11 +4256,11 @@ void cmMakefile::AddCMakeDependFilesFromUser()
|
|||||||
std::string cmMakefile::FormatListFileStack() const
|
std::string cmMakefile::FormatListFileStack() const
|
||||||
{
|
{
|
||||||
std::vector<std::string> listFiles;
|
std::vector<std::string> listFiles;
|
||||||
cmStateSnapshot snp = this->StateSnapshot;
|
for (auto snp = this->StateSnapshot; snp.IsValid();
|
||||||
while (snp.IsValid()) {
|
snp = snp.GetCallStackParent()) {
|
||||||
listFiles.push_back(snp.GetExecutionListFile());
|
listFiles.emplace_back(snp.GetExecutionListFile());
|
||||||
snp = snp.GetCallStackParent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::reverse(listFiles.begin(), listFiles.end());
|
std::reverse(listFiles.begin(), listFiles.end());
|
||||||
std::ostringstream tmp;
|
std::ostringstream tmp;
|
||||||
size_t depth = listFiles.size();
|
size_t depth = listFiles.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user