mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 02:30:39 +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 {
|
func toStrings(keys []*cid.Cid) []string {
|
||||||
strs := make([]string, 0)
|
strs := make([]string, 0, len(keys))
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
strs = append(strs, key.KeyString())
|
strs = append(strs, key.KeyString())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user