Skip to content

du: deduplicate Stat::new call#10584

Merged
ChrisDryden merged 4 commits intouutils:mainfrom
svlv:du-deduplicate-stat-new-call
Feb 2, 2026
Merged

du: deduplicate Stat::new call#10584
ChrisDryden merged 4 commits intouutils:mainfrom
svlv:du-deduplicate-stat-new-call

Conversation

@svlv
Copy link
Contributor

@svlv svlv commented Jan 30, 2026

Addresses the review comment from another PR by @ChrisDryden:

Ideally we would only have to stat this file once, and de-duplicate this call but that can be in another PR

Apologies for the long delay. I didn't have an opportunity to address it earlier.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

my_stat: Option<std::io::Result<Stat>>,
) -> Result<Stat, Box<mpsc::SendError<UResult<StatPrintInfo>>>> {
// Get initial stat for this path - use DirFd if available to avoid path length issues
let mut my_stat = if let Some(parent_fd) = parent_fd {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing to read, my_stat is immediately shadowed at the beginning of the function. Maybe it would be better to change the naming of it to indicate the difference between the two?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it would be better to change the name. I thought about that too.
Renamed

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@ChrisDryden ChrisDryden merged commit cb0ae79 into uutils:main Feb 2, 2026
130 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants