now less stupid
executing two functions seemed smart before I knew the implementation but now it seems really stupid
This commit is contained in:
parent
9357c0392c
commit
0ea4ce92f4
@ -35,13 +35,12 @@ std::vector<fs::path> find_all_folders(std::string filesystem_path) {
|
||||
}
|
||||
|
||||
std::vector<fs::path> find_all_files_and_folders(std::string filesystem_path) {
|
||||
std::vector<fs::path> files = find_all_files(filesystem_path);
|
||||
std::vector<fs::path> folders = find_all_folders(filesystem_path);
|
||||
std::vector<fs::path> files_and_folders = {};
|
||||
|
||||
files_and_folders.reserve(files.size() + folders.size());
|
||||
files_and_folders.insert( files_and_folders.end(), files.begin(), files.end() );
|
||||
files_and_folders.insert( files_and_folders.end(), folders.begin(), folders.end() );
|
||||
for (const fs::directory_entry &entry : fs::directory_iterator(filesystem_path)) {
|
||||
files_and_folders.insert(files_and_folders.begin()+files_and_folders.size(), entry.path());
|
||||
}
|
||||
|
||||
files_and_folders.shrink_to_fit();
|
||||
return files_and_folders;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user