@cryptotaxi247 / kubo / commits / 0c91b183e

bitswap: preallocate cid string array

License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Dec 5, 2017 at 10:01 UTC 0c91b183eb09e25c5c32bba314a4196378259091
1 file changed +1 -1
exchange/bitswap/notifications/notifications.go
+1 -1
@@ -73,7 +73,7 @@ func (ps *impl) Subscribe(ctx context.Context, keys ...*cid.Cid) <-chan blocks.B
73 }
74
75 func toStrings(keys []*cid.Cid) []string {
76 - strs := make([]string, 0)
76 + strs := make([]string, 0, len(keys))
77 for _, key := range keys {
78 strs = append(strs, key.KeyString())
79 }