update:use builtin cmp func (#4879)

This commit is contained in:
me-cs
2025-05-22 23:19:13 +08:00
committed by GitHub
parent e3c371ac89
commit b109b3ef4c
4 changed files with 9 additions and 24 deletions

View File

@@ -1,19 +1,13 @@
package mathx
// MaxInt returns the larger one of a and b.
// Deprecated: use builtin max instead.
func MaxInt(a, b int) int {
if a > b {
return a
}
return b
return max(a, b)
}
// MinInt returns the smaller one of a and b.
// Deprecated: use builtin min instead.
func MinInt(a, b int) int {
if a < b {
return a
}
return b
return min(a, b)
}