fix: 0 size

This commit is contained in:
loveuer
2024-08-05 11:07:08 +08:00
parent ebb4365135
commit 2c80079a8f
4 changed files with 28 additions and 6 deletions

View File

@ -7,3 +7,15 @@ func Min[T ~string | ~int | ~int64 | ~uint64 | ~float64 | ~float32 | ~int32 | ~u
return b
}
func AbsMin(a, b uint64) uint64 {
if a == 0 {
return b
}
if b == 0 {
return a
}
return Min(a, b)
}