net/netip: use strconv.AppendUint in AddrPort.AppendTo

This is already used in AddrPort.String.

name                               old time/op    new time/op    delta
AddrPortMarshalText/v4-4             67.9ns ± 3%    61.5ns ± 6%  -9.43%  (p=0.000 n=10+9)
AddrPortMarshalText/v6-4              168ns ± 4%     155ns ± 2%  -7.54%  (p=0.000 n=10+10)
AddrPortMarshalText/v6_ellipsis-4     169ns ± 3%     162ns ± 5%  -4.03%  (p=0.001 n=9+10)
AddrPortMarshalText/v6_v4-4          87.0ns ± 4%    85.8ns ± 4%    ~     (p=0.165 n=10+10)
AddrPortMarshalText/v6_zone-4         169ns ± 3%     166ns ± 3%    ~     (p=0.066 n=10+10)

Change-Id: If16eda4bf48224029dcaf2069ae87f8d89865d99
Reviewed-on: https://go-review.googlesource.com/c/go/+/404014
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Tobias Klauser 2022-05-04 09:20:56 +02:00 committed by Gopher Robot
parent 1b0f9fbb67
commit 037b209ae3
1 changed files with 1 additions and 1 deletions

View File

@ -1171,7 +1171,7 @@ func (p AddrPort) AppendTo(b []byte) []byte {
b = append(b, ']')
}
b = append(b, ':')
b = strconv.AppendInt(b, int64(p.port), 10)
b = strconv.AppendUint(b, uint64(p.port), 10)
return b
}