[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/03: Fix the implementation of par-map&
From: |
Christopher Baines |
Subject: |
02/03: Fix the implementation of par-map& |
Date: |
Sun, 4 Oct 2020 08:29:44 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit 93c98135461e3a415cbfdb894a619519537a1cf7
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Oct 4 13:22:35 2020 +0100
Fix the implementation of par-map&
It was pretty wrong...
---
guix-data-service/utils.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm
index c50cb64..cc9b7ac 100644
--- a/guix-data-service/utils.scm
+++ b/guix-data-service/utils.scm
@@ -133,9 +133,11 @@
(let loop ((lists lists))
(match lists
(((heads tails ...) ...)
- (let ((tail (defer-to-thread-pool-channel (loop tails)))
- (head (apply proc heads)))
- (cons head (fetch-result-of-defered-thunk tail))))
+ (let ((tail (loop tails))
+ (head (defer-to-thread-pool-channel
+ (lambda ()
+ (apply proc heads)))))
+ (cons (fetch-result-of-defered-thunk head) tail)))
(_
'())))))