You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
The memory implementation holds segments of protocols map[peer.ID]map[string]struct{}.
In GetProtocols(p peer.ID) a slice is preallocated to len((segment).protocols), which is the number of peers in that segment.
It was probably intended to be be len((segment).protocols[p]) instead.
A small performance bug:
The memory implementation holds segments of
protocols map[peer.ID]map[string]struct{}
.In
GetProtocols(p peer.ID)
a slice is preallocated tolen((segment).protocols)
, which is the number of peers in that segment.It was probably intended to be be
len((segment).protocols[p])
instead.Source: https://github.com/libp2p/go-libp2p-peerstore/blob/master/pstoremem/protobook.go#L134
Fix:
The text was updated successfully, but these errors were encountered: