From 1840ecc8442ac17527430a1941c82b9606341740 Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 1 Apr 2023 22:35:34 +0200 Subject: fix(async): early return if no suspend functions (#1165) --- lua/mason-core/async/init.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lua/mason-core/async/init.lua') diff --git a/lua/mason-core/async/init.lua b/lua/mason-core/async/init.lua index 0b327218..a6c7c8ef 100644 --- a/lua/mason-core/async/init.lua +++ b/lua/mason-core/async/init.lua @@ -188,6 +188,9 @@ end ---@param mode '"first"' | '"all"' local function wait(suspend_fns, mode) local channel = oneshot_channel() + if #suspend_fns == 0 then + return + end do local results = {} -- cgit v1.2.3-70-g09d2