1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

Replace our DirEntry with std::filesystem's

This commit is contained in:
John Ericson 2024-05-07 11:29:33 -04:00
parent c371070580
commit a3c573950b
18 changed files with 52 additions and 59 deletions

View file

@ -228,16 +228,14 @@ bool isLink(const Path & path)
}
DirEntries readDirectory(const Path & path)
std::vector<std::filesystem::directory_entry> readDirectory(const Path & path)
{
DirEntries entries;
std::vector<std::filesystem::directory_entry> entries;
entries.reserve(64);
for (auto & entry : fs::directory_iterator{path}) {
checkInterrupt();
entries.emplace_back(
entry.path().filename().string(),
entry.symlink_status().type());
entries.push_back(std::move(entry));
}
return entries;