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
commit 2a6a54dea5
Notes: sideshowbarker 2024-07-18 19:16:20 +09:00
6 changed files with 14 additions and 24 deletions

View file

@ -171,8 +171,7 @@ void DevicesModel::update()
auto fill_in_paths_from_dir = [this](const String& dir) {
Core::DirIterator dir_iter { dir, Core::DirIterator::Flags::SkipDots };
while (dir_iter.has_next()) {
auto name = dir_iter.next_path();
auto path = String::formatted("{}/{}", dir, name);
auto path = dir_iter.next_full_path();
struct stat statbuf;
if (lstat(path.characters(), &statbuf) != 0) {
VERIFY_NOT_REACHED();