Skip to content

sort: followup of #10068 #10226

Merged
cakebaker merged 2 commits intouutils:mainfrom
sylvestre:10068-followup
Jan 14, 2026
Merged

sort: followup of #10068 #10226
cakebaker merged 2 commits intouutils:mainfrom
sylvestre:10068-followup

Conversation

@sylvestre
Copy link
Contributor

No description provided.

Simplify the function by computing mode_count directly and using
early returns instead of accumulating a counter with nested if
statements.
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/sort/sort-debug-warn. tests/sort/sort-debug-warn is passing on 'main'. Maybe you have to rebase?
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 13, 2026

CodSpeed Performance Report

Merging this PR will improve performance by 4.39%

Comparing sylvestre:10068-followup (6ed0f08) with main (4ba5db0)1

Summary

⚡ 1 improved benchmark
✅ 140 untouched benchmarks
⏩ 38 skipped benchmarks2

Performance Changes

Benchmark BASE HEAD Efficiency
sort_long_line[160000] 1.8 ms 1.7 ms +4.39%

Footnotes

  1. No successful run was found on main (0b0ba60) during the generation of this report, so 4ba5db0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 38 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.

Comment on lines +514 to +517
let mode_count = u8::from(flags.numeric)
+ u8::from(flags.general_numeric)
+ u8::from(flags.human_numeric)
+ u8::from(flags.month);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice refactoring :)

@cakebaker cakebaker merged commit 8be7ca5 into uutils:main Jan 14, 2026
131 of 132 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