diff options
author | Benji Nguyen <45523555+solidiquis@users.noreply.github.com> | 2024-03-13 09:52:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 09:52:22 -0700 |
commit | ea26c0e5961f055db0bad281455edc6f429d5699 (patch) | |
tree | 466ac7dcbaa3cc3b4c7027ee771a595de471727b | |
parent | 393baea184981fc8660aaf32cb80406021d43ed6 (diff) | |
parent | 2f00a15deacda49248d0505badbbfca213bd65c4 (diff) |
Merge pull request #251 from TomLonergan03/long_poor_performance_fix
Improve performance when using `--long`
-rw-r--r-- | src/tree/node/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tree/node/mod.rs b/src/tree/node/mod.rs index b010469..a74270c 100644 --- a/src/tree/node/mod.rs +++ b/src/tree/node/mod.rs @@ -272,7 +272,9 @@ impl TryFrom<(DirEntry, &Context)> for Node { let inode = Inode::try_from(&metadata).ok(); #[cfg(unix)] - let unix_attrs = if ctx.long { + let unix_attrs = if ctx.long + && path.components().count() <= ctx.dir_canonical().components().count().saturating_add(ctx.level()) + { unix::Attrs::from((&metadata, &dir_entry)) } else { unix::Attrs::default() |