all: use built-in min and max functions#796
Merged
sbinet merged 2 commits intogonum:masterfrom Mar 26, 2025
Juneezee:minmax
Merged
all: use built-in min and max functions#796sbinet merged 2 commits intogonum:masterfrom Juneezee:minmax
sbinet merged 2 commits intogonum:masterfrom
Juneezee:minmax
Conversation
kortschak
reviewed
Mar 21, 2025
Member
kortschak
left a comment
There was a problem hiding this comment.
I'm not convinced this is a win.
Contributor
Author
Thank you for the review. I'm eager to make this PR beneficial for the project. May I know on what aspects you find it problematic? |
Member
|
In order to use the builtin, we need to reduce the simplicity of the documentation by changing the return parameter names. |
Juneezee
commented
Mar 21, 2025
We can use the built-in `min` and `max` functions since Go 1.21. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
https://github.com/gonum/plot/pull/796/files#r2008341728 Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
sbinet
approved these changes
Mar 25, 2025
Member
sbinet
left a comment
There was a problem hiding this comment.
LGTM
(the gain is somewhat marginal, but I guess it's in line with the "modernize" movement)
kortschak
approved these changes
Mar 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We can use the built-in
minandmaxfunctions since Go 1.21.Reference: https://go.dev/ref/spec#Min_and_max