chore: use cmp (#568)

This commit is contained in:
UUBulb
2024-12-08 20:21:35 +08:00
committed by GitHub
parent 96b254a7b1
commit 2bc3d38b83
6 changed files with 10 additions and 47 deletions

View File

@@ -1,11 +1,11 @@
package singleton
import (
"cmp"
"slices"
"sync"
"github.com/nezhahq/nezha/model"
"github.com/nezhahq/nezha/pkg/utils"
)
var (
@@ -64,7 +64,7 @@ func UpdateNATList() {
NATList = append(NATList, n)
}
slices.SortFunc(NATList, func(a, b *model.NAT) int {
return utils.Compare(a.ID, b.ID)
return cmp.Compare(a.ID, b.ID)
})
}