go-ethereum/p2p/netutil
Martin HS 767c202e47
all: drop x/exp direct dependency (#30558)
This is a not-particularly-important "cleanliness" PR. It removes the
last remnants of the `x/exp` package, where we used the `maps.Keys`
function.

The original returned the keys in a slice, but when it became 'native'
the signature changed to return an iterator, so the new idiom is
`slices.Collect(maps.Keys(theMap))`, unless of course the raw iterator
can be used instead.

In some cases, where we previously collect into slice and then sort, we
can now instead do `slices.SortXX` on the iterator instead, making the
code a bit more concise.

This PR might be _slighly_ less optimal, because the original `x/exp`
implementation allocated the slice at the correct size off the bat,
which I suppose the new code won't.

Putting it up for discussion.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-27 15:53:52 +01:00
..
addrutil.go p2p: use netip.Addr where possible (#29891) 2024-06-05 19:31:04 +02:00
addrutil_test.go p2p/netutil: unittests for addrutil (#30439) 2024-11-11 11:43:22 +01:00
error.go p2p/discover: implement v5.1 wire protocol (#21647) 2020-10-14 12:28:17 +02:00
error_test.go p2p/netutil: minor code cosmetic 2022-07-25 12:52:49 +03:00
iptrack.go p2p: use netip.Addr where possible (#29891) 2024-06-05 19:31:04 +02:00
iptrack_test.go p2p: use netip.Addr where possible (#29891) 2024-06-05 19:31:04 +02:00
net.go all: drop x/exp direct dependency (#30558) 2025-02-27 15:53:52 +01:00
net_test.go p2p: use netip.Addr where possible (#29891) 2024-06-05 19:31:04 +02:00
toobig_notwindows.go all: add go:build lines (#23468) 2021-08-25 18:46:29 +02:00
toobig_windows.go all: add go:build lines (#23468) 2021-08-25 18:46:29 +02:00