Skip to content

mastodon: add ID.Compare to sort IDs #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2025
Merged

Conversation

sbinet
Copy link
Collaborator

@sbinet sbinet commented Jan 16, 2025

This CL adds the Compare method to ID in order to make slices of IDs
sortable (e.g. via slices.SortFunc(ids, mastodon.ID.Compare))

This CL adds the Compare method to ID in order to make slices of IDs
sortable (e.g. via slices.SortFunc(ids, mastodon.ID.Compare))

Signed-off-by: Sebastien Binet <[email protected]>
This CL removes the naive use of fmt.Sprintf in lieu of
strconv.FormatInt, which should be slightly more efficient.

Signed-off-by: Sebastien Binet <[email protected]>
@mattn
Copy link
Owner

mattn commented Jan 16, 2025

good catch about fmt.Sprint
thank you

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.96%. Comparing base (9faaa4f) to head (de51df5).
Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
compat.go 86.95% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (9faaa4f) and HEAD (de51df5). Click for more details.

HEAD has 7 uploads less than BASE
Flag BASE (9faaa4f) HEAD (de51df5)
12 5
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #197      +/-   ##
==========================================
- Coverage   87.51%   77.96%   -9.56%     
==========================================
  Files          15       19       +4     
  Lines        1354     1652     +298     
==========================================
+ Hits         1185     1288     +103     
- Misses        125      308     +183     
- Partials       44       56      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mattn mattn merged commit 5a39ea1 into mattn:master Jan 16, 2025
6 of 8 checks passed
@mattn
Copy link
Owner

mattn commented Jan 16, 2025

Thank you

@sbinet sbinet deleted the compare-id branch January 17, 2025 08:47
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