From a7786b48295123c5ef3a4628201e602cc1360943 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Sat, 10 Nov 2018 21:27:33 -0600 Subject: [PATCH] Pass nil to callback function --- async.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/async.lua b/async.lua index 2f04005..69bdcef 100644 --- a/async.lua +++ b/async.lua @@ -149,7 +149,7 @@ end function extended_api.Async.chain_task(pool,tasks,callback) extended_api.Async.create_worker(pool,function() - local pass_arg = {} + local pass_arg = nil local last_time = minetest.get_us_time() * 1000 local maxtime = pool.maxtime for index, task_func in pairs(tasks) do @@ -174,14 +174,14 @@ function extended_api.Async.queue_task(pool,func,callback) if pool.queue_threads > 0 then pool.queue_threads = pool.queue_threads - 1 extended_api.Async.create_worker(pool,function() - local pass_arg = {} + local pass_arg = nil local last_time = minetest.get_us_time() * 1000 local maxtime = pool.maxtime while(true) do local task_func = pool.task_queue[1] table.remove(pool.task_queue,1) if task_func and task_func.func then - pass_arg = {} + pass_arg = nil local p = task_func.func(pass_arg) if p then pass_arg = p