From 0c91b183eb09e25c5c32bba314a4196378259091 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 5 Dec 2017 10:01:17 -0800 Subject: [PATCH] bitswap: preallocate cid string array License: MIT Signed-off-by: Steven Allen --- exchange/bitswap/notifications/notifications.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exchange/bitswap/notifications/notifications.go b/exchange/bitswap/notifications/notifications.go index 4b1a62eea..6d1e11801 100644 --- a/exchange/bitswap/notifications/notifications.go +++ b/exchange/bitswap/notifications/notifications.go @@ -73,7 +73,7 @@ func (ps *impl) Subscribe(ctx context.Context, keys ...*cid.Cid) <-chan blocks.B } func toStrings(keys []*cid.Cid) []string { - strs := make([]string, 0) + strs := make([]string, 0, len(keys)) for _, key := range keys { strs = append(strs, key.KeyString()) }