stdlib: asyncdispatch: all: Redundant closure removed.
This commit is contained in:
parent
a29f8df5bb
commit
83af9888f5
1 changed files with 5 additions and 8 deletions
|
|
@ -369,16 +369,13 @@ proc all*[T](futs: varargs[Future[T]]): auto =
|
||||||
|
|
||||||
let totalFutures = len(futs)
|
let totalFutures = len(futs)
|
||||||
|
|
||||||
for i, fut in futs:
|
for fut in futs:
|
||||||
proc setCallback(i: int) =
|
|
||||||
fut.callback = proc(f: Future[T]) =
|
fut.callback = proc(f: Future[T]) =
|
||||||
inc(completedFutures)
|
inc(completedFutures)
|
||||||
|
|
||||||
if completedFutures == totalFutures:
|
if completedFutures == totalFutures:
|
||||||
retFuture.complete()
|
retFuture.complete()
|
||||||
|
|
||||||
setCallback(i)
|
|
||||||
|
|
||||||
return retFuture
|
return retFuture
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue