mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
refs #104, performance related refactoring
This commit is contained in:
parent
0e5f2f5d1b
commit
8a19af1f63
@ -2226,12 +2226,12 @@ GHC_INLINE file_status status_ex(const path& p, std::error_code& ec, file_status
|
||||
if (result == 0) {
|
||||
ec.clear();
|
||||
file_status fs = detail::file_status_from_st_mode(st.st_mode);
|
||||
if (sls) {
|
||||
*sls = fs;
|
||||
}
|
||||
if (fs.type() == file_type::symlink) {
|
||||
result = ::stat(p.c_str(), &st);
|
||||
if (result == 0) {
|
||||
if (sls) {
|
||||
*sls = fs;
|
||||
}
|
||||
fs = detail::file_status_from_st_mode(st.st_mode);
|
||||
}
|
||||
}
|
||||
@ -5487,7 +5487,7 @@ public:
|
||||
if (_entry) {
|
||||
_current = _base;
|
||||
_current.append_name(_entry->d_name);
|
||||
_dir_entry = directory_entry(_current, ec);
|
||||
_dir_entry.assign(_current, ec);
|
||||
if (ec && (ec.value() == EACCES || ec.value() == EPERM) && (_options & directory_options::skip_permission_denied) == directory_options::skip_permission_denied) {
|
||||
ec.clear();
|
||||
skip = true;
|
||||
@ -5730,13 +5730,7 @@ GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::operator+
|
||||
|
||||
GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::increment(std::error_code& ec) noexcept
|
||||
{
|
||||
auto status = (*this)->status(ec);
|
||||
if (ec)
|
||||
return *this;
|
||||
auto symlink_status = (*this)->symlink_status(ec);
|
||||
if (ec)
|
||||
return *this;
|
||||
if (recursion_pending() && is_directory(status) && (!is_symlink(symlink_status) || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
|
||||
if (recursion_pending() && (*this)->is_directory() && (!(*this)->is_symlink() || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
|
||||
_impl->_dir_iter_stack.push(directory_iterator((*this)->path(), _impl->_options, ec));
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user