-
Notifications
You must be signed in to change notification settings - Fork 325
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
refactor: use built-in min
function
#1038
Conversation
We can use the built-in `min` function since Go 1.21. Reference: https://go.dev/ref/spec#Min_and_max Signed-off-by: Eng Zer Jun <[email protected]>
📝 WalkthroughWalkthroughThe changes involve removing Changes
Sequence DiagramsequenceDiagram
participant Code as Original Code
participant Utility as Utility Functions
participant NewCode as Updated Code
Code->>Utility: Call min/min64 functions
Utility-->>Code: Return minimum value
Code->>NewCode: Direct inline comparison
NewCode-->>Code: Return minimum value
The sequence diagram illustrates the transition from using separate utility functions for minimum value calculation to performing direct inline comparisons, which simplifies the code structure without changing its fundamental behavior. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
🔇 Additional comments (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
We can use the built-in
min
function since Go 1.21.Reference: https://go.dev/ref/spec#Min_and_max
Summary by CodeRabbit
Refactor
min
andmin64
utility functions across multiple packagesTests
The changes primarily focus on code simplification and removal of redundant utility functions without impacting core functionality.