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

use copy instead of looping

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen
2018-06-27 16:52:57 -07:00
parent f5d810932e
commit 12719a788f

View File

@ -75,9 +75,7 @@ func (dr *PBDagReader) preloadNextNodes(ctx context.Context) {
end = len(dr.links)
}
for i, p := range ipld.GetNodes(ctx, dr.serv, dr.links[beg:end]) {
dr.promises[beg+i] = p
}
copy(dr.promises[beg:], ipld.GetNodes(ctx, dr.serv, dr.links[beg:end]))
}
// precalcNextBuf follows the next link in line and loads it from the