Skip to content

Commit

Permalink
pstoremem: fix slice preallocation in GetProtocols (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrd0ll4r authored Apr 21, 2022
1 parent abc52a3 commit 8a547c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/host/peerstore/pstoremem/protobook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 8a547c5

Please sign in to comment.