Skip to content

simplify the ls code#11391

Merged
cakebaker merged 3 commits intouutils:mainfrom
sylvestre:simpl_ls
Mar 23, 2026
Merged

simplify the ls code#11391
cakebaker merged 3 commits intouutils:mainfrom
sylvestre:simpl_ls

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/basenc/bounded-memory is now passing!
Congrats! The gnu test tests/dd/no-allocate is now passing!
Congrats! The gnu test tests/unexpand/bounded-memory is now passing!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 18, 2026

Merging this PR will not alter performance

✅ 300 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing sylvestre:simpl_ls (eb0cf75) with main (30b96a1)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sylvestre sylvestre marked this pull request as ready for review March 19, 2026 06:37
@sylvestre sylvestre requested review from cakebaker and drinkcat March 19, 2026 08:30

fn calculate_line_len(output_len: usize, item_len: usize, line_ending: LineEnding) -> usize {
output_len + item_len + line_ending.to_string().len()
fn calculate_line_len(output_len: usize, item_len: usize, _line_ending: LineEnding) -> usize {
Copy link
Copy Markdown
Contributor

@cakebaker cakebaker Mar 19, 2026

Choose a reason for hiding this comment

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

I would remove either the _line_ending param to simplify the function signature. Or the entire function. The function is called in a single place and so the (trivial) calculation could be done there.

Both approaches also allow you to simplify the signature of update_dired_for_item.

Copy link
Copy Markdown
Collaborator

@drinkcat drinkcat left a comment

Choose a reason for hiding this comment

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

Overall looks good

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/seq/seq-epipe is no longer failing!
Note: The gnu test tests/cut/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.

@cakebaker cakebaker merged commit 3924d09 into uutils:main Mar 23, 2026
157 of 159 checks passed
// and we already have the previous position in mind
dired.padding += total_len + DIRED_TRAILING_OFFSET;
}
dired.padding += total_len + DIRED_TRAILING_OFFSET;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch :)

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.

3 participants