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,15 +369,12 @@ proc all*[T](futs: varargs[Future[T]]): auto =
|
|||
|
||||
let totalFutures = len(futs)
|
||||
|
||||
for i, fut in futs:
|
||||
proc setCallback(i: int) =
|
||||
fut.callback = proc(f: Future[T]) =
|
||||
inc(completedFutures)
|
||||
for fut in futs:
|
||||
fut.callback = proc(f: Future[T]) =
|
||||
inc(completedFutures)
|
||||
|
||||
if completedFutures == totalFutures:
|
||||
retFuture.complete()
|
||||
|
||||
setCallback(i)
|
||||
if completedFutures == totalFutures:
|
||||
retFuture.complete()
|
||||
|
||||
return retFuture
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue