Skip to content

Commit 27f1f14

Browse files
cuishuanggopherbot
authored andcommitted
all: use the built-in min/max function
Starting from Go 1.21, the min/max functions are built-in. Therefore, we can remove the custom functions with the same name. Change-Id: I8b7446923f4804bfb2693b1f9c75463844215921 Reviewed-on: https://go-review.googlesource.com/c/exp/+/707495 Auto-Submit: Sean Liao <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Sean Liao <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Reviewed-by: Junyang Shao <[email protected]>
1 parent df92998 commit 27f1f14

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

rand/rand_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ type statsResults struct {
2828
maxError float64
2929
}
3030

31-
func max(a, b float64) float64 {
32-
if a > b {
33-
return a
34-
}
35-
return b
36-
}
37-
3831
func nearEqual(a, b, closeEnough, maxError float64) bool {
3932
absDiff := math.Abs(a - b)
4033
if absDiff < closeEnough { // Necessary when one value is zero and one value is close to zero.

shiny/text/text_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ import (
2020
"golang.org/x/image/math/fixed"
2121
)
2222

23-
func min(a, b int) int {
24-
if a < b {
25-
return a
26-
}
27-
return b
28-
}
29-
3023
func readAllText(dst []byte, f *Frame) []byte {
3124
for p := f.FirstParagraph(); p != nil; p = p.Next(f) {
3225
for l := p.FirstLine(f); l != nil; l = l.Next(f) {

0 commit comments

Comments
 (0)