all: update exp/slices and fix call sites

slices.SortFunc suffered a late-in-cycle API breakage.

Updates #cleanup

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2023-07-28 10:39:04 -07:00
committed by Dave Anderson
parent 90a7d3066c
commit 52212f4323
16 changed files with 91 additions and 50 deletions

View File

@@ -396,7 +396,7 @@ func configureInterface(cfg *Config, tun *tun.NativeTun) (retErr error) {
return fmt.Errorf("syncAddresses: %w", err)
}
slices.SortFunc(routes, routeDataLess)
slices.SortFunc(routes, routeDataCompare)
deduplicatedRoutes := []*winipcfg.RouteData{}
for i := 0; i < len(routes); i++ {
@@ -652,8 +652,8 @@ func routeDataCompare(a, b *winipcfg.RouteData) int {
func deltaRouteData(a, b []*winipcfg.RouteData) (add, del []*winipcfg.RouteData) {
add = make([]*winipcfg.RouteData, 0, len(b))
del = make([]*winipcfg.RouteData, 0, len(a))
slices.SortFunc(a, routeDataLess)
slices.SortFunc(b, routeDataLess)
slices.SortFunc(a, routeDataCompare)
slices.SortFunc(b, routeDataCompare)
i := 0
j := 0