Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

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 f0dc314 commit e9c56d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 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 e9c56d2

Please sign in to comment.