-
Notifications
You must be signed in to change notification settings - Fork 64
refactor: Modernize sorting #1947
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
Conversation
Replaced sort.Slice and sort.SliceStable with the more modern and performant slices.Sort and slices.SortStable. Also fixed some unrelated linting errors.
WalkthroughThe changes systematically replace usages of Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Keeper
participant SlicesPkg
Caller->>Keeper: Call sorting function (e.g., ValidatorIntents.Sort)
Keeper->>SlicesPkg: Use slices.SortFunc/SortStableFunc with integer comparator
SlicesPkg-->>Keeper: Returns sorted slice
Keeper-->>Caller: Returns result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
🧰 Additional context used🧠 Learnings (5)x/interchainstaking/keeper/callbacks.go (7)Learnt from: joe-bowman Learnt from: joe-bowman Learnt from: joe-bowman Learnt from: joe-bowman Learnt from: joe-bowman Learnt from: arhamchordia Learnt from: joe-bowman x/interchainstaking/keeper/keeper.go (3)Learnt from: joe-bowman Learnt from: arhamchordia Learnt from: joe-bowman x/interchainstaking/keeper/fuzz_test.go (1)Learnt from: arhamchordia x/supply/keeper/keeper.go (2)Learnt from: arhamchordia Learnt from: joe-bowman x/interchainstaking/keeper/zones_test.go (1)Learnt from: arhamchordia ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (16)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1947 +/- ##
==========================================
- Coverage 57.63% 57.62% -0.01%
==========================================
Files 172 172
Lines 15268 15296 +28
==========================================
+ Hits 8800 8815 +15
- Misses 5702 5710 +8
- Partials 766 771 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
1. Summary
Fixes #1946
2.Type of change
3. Implementation details
Migrate sort.Slice and sort.StableSlice to new slices.SortFunc and slices.StableSortFunc introduced in go1.22.
Summary by CodeRabbit
Refactor
Tests