From f17a4a86677c48b1cced0b0e65b8218a280307c6 Mon Sep 17 00:00:00 2001 From: vyzo Date: Fri, 19 Apr 2019 19:39:00 +0300 Subject: [PATCH] preallocate map in sameAddrs --- p2p/host/basic/basic_host.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index 9fa5441fa7..1b11bbdc80 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -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{}{} }