Skip to content

prefer slices.SortFunc to sort.Sort - #796

Merged
gammazero merged 3 commits into
mainfrom
prefer-slices-sort
Jan 21, 2025
Merged

gammazero merged 3 commits into
mainfrom
prefer-slices-sort

Conversation

@gammazero

Copy link
Copy Markdown
Contributor

In many situations, the newer slices.SortFunc function is more ergonomic and runs faster than sort.Sort. Using slices.SortFunc also avoids having to define custom slice types to make slices of objects sortable.

In many situations, the newer `slices.SortFunc` function is more ergonomic and runs faster than `sort.Sort`. Using `slices.SortFunc` also avoids having to define custom slice types to make slices of objects sortable.
@gammazero
gammazero requested review from a team and lidel as code owners January 17, 2025 21:32
@codecov

codecov Bot commented Jan 17, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 71.87500% with 9 lines in your changes missing coverage. Please review.

Project coverage is 60.47%. Comparing base (3586985) to head (65fec9a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
filestore/util.go 0.00% 8 Missing ⚠️
routing/http/client/client.go 50.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #796      +/-   ##
==========================================
- Coverage   60.53%   60.47%   -0.07%     
==========================================
  Files         245      245              
  Lines       31130    31124       -6     
==========================================
- Hits        18846    18823      -23     
- Misses      10608    10623      +15     
- Partials     1676     1678       +2     
Files with missing lines Coverage Δ
bitswap/client/wantlist/wantlist.go 90.47% <100.00%> (-0.15%) ⬇️
bitswap/server/server.go 56.57% <100.00%> (+1.19%) ⬆️
gateway/headers.go 100.00% <100.00%> (ø)
ipld/merkledag/coding.go 78.03% <100.00%> (-0.33%) ⬇️
ipld/merkledag/node.go 84.48% <100.00%> (+0.05%) ⬆️
ipns/record.go 68.21% <100.00%> (ø)
routing/http/client/client.go 70.83% <50.00%> (ø)
filestore/util.go 0.00% <0.00%> (ø)

... and 11 files with indirect coverage changes

@gammazero
gammazero merged commit bcf475c into main Jan 21, 2025
@gammazero
gammazero deleted the prefer-slices-sort branch January 21, 2025 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant