1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +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

@ -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();