Fix formatting in merkledag.go
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Feb 17, 2017 at 08:39 UTC
67a3a67aa8557f9e6a05ccc25b56b8c86a9bb05e
1 file changed
+6
-6
merkledag/merkledag.go
+6
-6
@@ -399,12 +399,12 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
399
done := make(chan struct{})
400
401
var setlk sync.Mutex
402
-
402
+
403
errChan := make(chan error)
404
fetchersCtx, cancel := context.WithCancel(ctx)
405
-
405
+
406
defer cancel()
407
-
407
+
408
for i := 0; i < FetchGraphConcurrency; i++ {
409
go func() {
410
for ic := range feed {
@@ -413,11 +413,11 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
413
errChan <- err
414
return
415
}
416
-
416
+
417
setlk.Lock()
418
unseen := visit(ic)
419
setlk.Unlock()
420
-
420
+
421
if unseen {
422
select {
423
case out <- n:
@@ -466,7 +466,7 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
466
}
467
case err := <-errChan:
468
return err
469
-
469
+
470
case <-ctx.Done():
471
return ctx.Err()
472
}