mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-12 23:43:59 +03:00
cmMakefile::FormatListFileStack: Exit early on empty stack trace
And deindent the rest of the function.
This commit is contained in:
1 parent
29fb605822
commit
ce991188f3
1 file changed
+14
-11
+14
-11
@@ -4261,20 +4261,23 @@ std::string cmMakefile::FormatListFileStack() const
|
||||
listFiles.emplace_back(snp.GetExecutionListFile());
|
||||
}
|
||||
|
||||
if (listFiles.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::reverse(listFiles.begin(), listFiles.end());
|
||||
std::ostringstream tmp;
|
||||
size_t depth = listFiles.size();
|
||||
if (depth > 0) {
|
||||
auto it = listFiles.end();
|
||||
do {
|
||||
if (depth != listFiles.size()) {
|
||||
tmp << "\n ";
|
||||
}
|
||||
--it;
|
||||
tmp << '[' << depth << "]\t" << *it;
|
||||
depth--;
|
||||
} while (it != listFiles.begin());
|
||||
}
|
||||
auto it = listFiles.end();
|
||||
do {
|
||||
if (depth != listFiles.size()) {
|
||||
tmp << "\n ";
|
||||
}
|
||||
--it;
|
||||
tmp << '[' << depth << "]\t" << *it;
|
||||
depth--;
|
||||
} while (it != listFiles.begin());
|
||||
|
||||
return tmp.str();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user