From 289c7916d34e6be898d00680d26b8e1b1c6f8e35 Mon Sep 17 00:00:00 2001 From: Mandimby RAVELOARINJAKA Date: Fri, 29 Dec 2023 10:41:42 -0500 Subject: [PATCH] create a table instead of an array to hold the fibers in pmap-full --- spork/ev-utils.janet | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spork/ev-utils.janet b/spork/ev-utils.janet index 470b53e..722e20d 100644 --- a/spork/ev-utils.janet +++ b/spork/ev-utils.janet @@ -82,8 +82,9 @@ (def chan (ev/chan)) (def res (if (dictionary? data) @{} @[])) (join chan - (seq [[i x] :pairs data] - (ev/go (fiber/new (fn [] (put res i (f x))) :tp) nil chan))) + (tabseq [[i x] :pairs data + :let [fib (ev/go (fiber/new (fn [] (put res i (f x))) :tp) nil chan)]] + fib fib)) res) (defn pmap-limited