1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 08:47:42 +08:00

bitswap: preallocate cid string array

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen
2017-12-05 10:01:17 -08:00
parent a589470329
commit 0c91b183eb

View File

@ -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())
}