all: use new Go 1.23 slices.Sorted more
Updates #12912 Change-Id: If1294e5bc7b5d3cf0067535ae10db75e8b988d8b Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
fd6686d81a
commit
3d401c11fa
@@ -7,11 +7,12 @@ import (
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"net"
|
||||
"net/netip"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"sort"
|
||||
"slices"
|
||||
"sync"
|
||||
"time"
|
||||
"unsafe"
|
||||
@@ -907,12 +908,7 @@ func (c *Conn) foreachActiveDerpSortedLocked(fn func(regionID int, ad activeDerp
|
||||
}
|
||||
return
|
||||
}
|
||||
ids := make([]int, 0, len(c.activeDerp))
|
||||
for id := range c.activeDerp {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
sort.Ints(ids)
|
||||
for _, id := range ids {
|
||||
for _, id := range slices.Sorted(maps.Keys(c.activeDerp)) {
|
||||
fn(id, c.activeDerp[id])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user