all: remove LenIter, use Go 1.22 range-over-int instead

Updates #11058
Updates golang/go#65685

Change-Id: Ibb216b346e511d486271ab3d84e4546c521e4e22
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-02-25 07:57:11 -08:00
committed by Brad Fitzpatrick
parent ff1391a97e
commit e1bd7488d0
18 changed files with 45 additions and 81 deletions

View File

@@ -1793,7 +1793,7 @@ func nodesEqual(x, y views.Slice[tailcfg.NodeView]) bool {
if x.Len() != y.Len() {
return false
}
for i := range x.LenIter() {
for i := range x.Len() {
if !x.At(i).Equal(y.At(i)) {
return false
}
@@ -2056,7 +2056,7 @@ func (c *Conn) logEndpointCreated(n tailcfg.NodeView) {
fmt.Fprintf(w, "derp=%v%s ", regionID, code)
}
for i := range n.AllowedIPs().LenIter() {
for i := range n.AllowedIPs().Len() {
a := n.AllowedIPs().At(i)
if a.IsSingleIP() {
fmt.Fprintf(w, "aip=%v ", a.Addr())
@@ -2064,7 +2064,7 @@ func (c *Conn) logEndpointCreated(n tailcfg.NodeView) {
fmt.Fprintf(w, "aip=%v ", a)
}
}
for i := range n.Endpoints().LenIter() {
for i := range n.Endpoints().Len() {
ep := n.Endpoints().At(i)
fmt.Fprintf(w, "ep=%v ", ep)
}