pstoremem: fix slice preallocation in GetProtocols (#198)

This commit is contained in:
Leo Balduf 2022-04-21 14:29:45 +02:00 committed by GitHub
parent f0dc314e08
commit e9c56d257b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,7 @@ func (pb *memoryProtoBook) GetProtocols(p peer.ID) ([]string, error) {
s.RLock()
defer s.RUnlock()
out := make([]string, 0, len(s.protocols))
out := make([]string, 0, len(s.protocols[p]))
for k := range s.protocols[p] {
out = append(out, k)
}