mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 13:48:33 -05:00
cmMakefile::FormatListFileStack: Refactor "manual" loop into algorithms
This commit is contained in:
+7
-13
@@ -4265,20 +4265,14 @@ std::string cmMakefile::FormatListFileStack() const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::reverse(listFiles.begin(), listFiles.end());
|
auto depth = 1;
|
||||||
std::ostringstream tmp;
|
std::transform(listFiles.begin(), listFiles.end(), listFiles.begin(),
|
||||||
size_t depth = listFiles.size();
|
[&depth](const std::string& file) {
|
||||||
auto it = listFiles.end();
|
return cmStrCat('[', depth++, "]\t", file);
|
||||||
do {
|
});
|
||||||
if (depth != listFiles.size()) {
|
|
||||||
tmp << "\n ";
|
|
||||||
}
|
|
||||||
--it;
|
|
||||||
tmp << '[' << depth << "]\t" << *it;
|
|
||||||
depth--;
|
|
||||||
} while (it != listFiles.begin());
|
|
||||||
|
|
||||||
return tmp.str();
|
return cmJoinStrings(cmMakeRange(listFiles.rbegin(), listFiles.rend()),
|
||||||
|
"\n "_s, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::PushScope()
|
void cmMakefile::PushScope()
|
||||||
|
|||||||
Reference in New Issue
Block a user