diff options
author | Константин Молчанов <moigagoo@km.local> | 2016-06-02 17:20:46 +0300 |
---|---|---|
committer | Константин Молчанов <moigagoo@km.local> | 2016-06-02 17:20:46 +0300 |
commit | 83af9888f584f354a5318812e9c90f3f3f210f19 (patch) | |
tree | 980cdee4310e0c68cd425c6a7438c27b485c781a /lib | |
parent | a29f8df5bb76d24c9ac5d8ed8b8282968111cf4c (diff) | |
download | Nim-83af9888f584f354a5318812e9c90f3f3f210f19.tar.gz |
stdlib: asyncdispatch: `all`: Redundant closure removed.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/asyncdispatch.nim | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim index 624836358..7cf1a36e3 100644 --- a/lib/pure/asyncdispatch.nim +++ b/lib/pure/asyncdispatch.nim @@ -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 |