We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0dc73c commit f5ab6a3Copy full SHA for f5ab6a3
core/commands/ls.go
@@ -212,20 +212,15 @@ The JSON output contains type information.
212
}
213
214
func makeDagNodeLinkResults(req *cmds.Request, dagnode ipld.Node) <-chan unixfs.LinkResult {
215
- linkResults := make(chan unixfs.LinkResult)
216
- go func() {
217
- defer close(linkResults)
218
- for _, l := range dagnode.Links() {
219
- select {
220
- case linkResults <- unixfs.LinkResult{
221
- Link: l,
222
- Err: nil,
223
- }:
224
- case <-req.Context.Done():
225
- return
226
- }
+ links := dagnode.Links()
+ linkResults := make(chan unixfs.LinkResult, len(links))
+ defer close(linkResults)
+ for _, l := range links {
+ linkResults <- unixfs.LinkResult{
+ Link: l,
+ Err: nil,
227
228
- }()
+ }
229
return linkResults
230
231
0 commit comments