diff --git a/ostd/path.hh b/ostd/path.hh index faf05d5..11197a5 100644 --- a/ostd/path.hh +++ b/ostd/path.hh @@ -907,18 +907,6 @@ struct directory_entry { return p_path; } - void clear() { - p_path.clear(); - } - - void assign(ostd::path const &p) { - p_path = p; - } - - void assign(ostd::path &&p) { - p_path = std::move(p); - } - private: ostd::path p_path{}; }; diff --git a/src/posix/path.cc b/src/posix/path.cc index 7894531..8f2628b 100644 --- a/src/posix/path.cc +++ b/src/posix/path.cc @@ -102,7 +102,7 @@ static void dir_read_next(DIR *dh, directory_entry &cur, path const &base) { abort(); } if (!o) { - cur.clear(); + cur = directory_entry{}; return; } string_range nm{static_cast(o->d_name)}; @@ -111,7 +111,7 @@ static void dir_read_next(DIR *dh, directory_entry &cur, path const &base) { } path p{base}; p.append(nm); - cur.assign(std::move(p)); + cur = std::move(p); break; } } @@ -190,7 +190,7 @@ OSTD_EXPORT void rdir_range_impl::read_next() { p_dir.remove_name(); dir_read_next(static_cast(p_handles.top()), p_current, p_dir); } else { - p_current.clear(); + p_current = directory_entry{}; } } }