refactor: replace min/max helpers with built-in min/max

We can use the built-in `min` and `max` functions since Go 1.21.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2025-01-27 00:30:45 +08:00
parent bac699df8f
commit 0899cee987
7 changed files with 6 additions and 116 deletions

View File

@@ -85,9 +85,7 @@ func NewSimpleGraph(g ChannelGraph) (*SimpleGraph, error) {
func maxVal(mapping map[int]uint32) uint32 {
maxValue := uint32(0)
for _, value := range mapping {
if maxValue < value {
maxValue = value
}
maxValue = max(maxValue, value)
}
return maxValue
}