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:
@ -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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user