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 committed 2025-02-06 09:45:10 +08:00
1 parent bac699df8f
commit 0899cee987
7 files changed
+6 -116

No files matched your search

+1 -3
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
}