fix(Callback when there is no tasks):

This commit is contained in:
Jérémie N'gadi
2017-10-13 09:12:58 +02:00
parent 1ced628632
commit 7fd3bfda35
+6
View File
@@ -6,6 +6,11 @@ Async = {}
function Async.parallel(tasks, cb)
if #tasks == 0 then
cb({})
return
end
local remaining = #tasks
local results = {}
@@ -35,6 +40,7 @@ function Async.parallelLimit(tasks, limit, cb)
if #tasks == 0 then
cb({})
return
end
local remaining = #tasks