1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 17:27:46 +00:00

Userland: Use Core::DirIterator::next_full_path()

Simplify some code by using this instead of concatenating the full path
ourselves at the call site.
This commit is contained in:
Andreas Kling 2021-04-21 22:16:32 +02:00
parent b41b6dd279
commit 2a6a54dea5
6 changed files with 14 additions and 24 deletions

View file

@ -197,7 +197,7 @@ static void iterate_directory_recursively(const String& directory_path, Callback
Core::DirIterator directory_iterator(directory_path, Core::DirIterator::Flags::SkipDots);
while (directory_iterator.has_next()) {
auto file_path = String::formatted("{}/{}", directory_path, directory_iterator.next_path());
auto file_path = directory_iterator.next_full_path();
if (Core::File::is_directory(file_path)) {
iterate_directory_recursively(file_path, callback);
} else {

View file

@ -168,7 +168,7 @@ void iterate_directory_recursively(const String& directory_path, Callback callba
Core::DirIterator directory_iterator(directory_path, Core::DirIterator::Flags::SkipDots);
while (directory_iterator.has_next()) {
auto file_path = String::format("%s/%s", directory_path.characters(), directory_iterator.next_path().characters());
auto file_path = directory_iterator.next_full_path();
if (Core::File::is_directory(file_path)) {
iterate_directory_recursively(file_path, callback);
} else {