diff --git a/src/net/netip/netip.go b/src/net/netip/netip.go index d709c56dfa..b613a5c82f 100644 --- a/src/net/netip/netip.go +++ b/src/net/netip/netip.go @@ -335,9 +335,7 @@ func parseIPv6(in string) (Addr, error) { for j := i - 1; j >= ellipsis; j-- { ip[j+n] = ip[j] } - for j := ellipsis + n - 1; j >= ellipsis; j-- { - ip[j] = 0 - } + clear(ip[ellipsis : ellipsis+n]) } else if ellipsis >= 0 { // Ellipsis must represent at least one 0 group. return Addr{}, parseAddrError{in: in, msg: "the :: must expand to at least one field of zeros"}