Skip to content

Commit

Permalink
Merge pull request #251 from TomLonergan03/long_poor_performance_fix
Browse files Browse the repository at this point in the history
Improve performance when using `--long`
  • Loading branch information
solidiquis authored Mar 13, 2024
2 parents 393baea + 2f00a15 commit ea26c0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tree/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ea26c0e

Please sign in to comment.