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:
parent
c371070580
commit
a3c573950b
18 changed files with 52 additions and 59 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue