Skip to content

Commit

Permalink
preallocate map in sameAddrs
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Apr 19, 2019
1 parent ebc5d16 commit f17a4a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func sameAddrs(a, b []ma.Multiaddr) bool {
return false
}

bmap := make(map[string]struct{})
bmap := make(map[string]struct{}, len(b))
for _, addr := range b {
bmap[string(addr.Bytes())] = struct{}{}
}
Expand Down

0 comments on commit f17a4a8

Please sign in to comment.