[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/04: Fix chunk-for-each! calling proc when there's nothing to do
From: |
Christopher Baines |
Subject: |
03/04: Fix chunk-for-each! calling proc when there's nothing to do |
Date: |
Fri, 14 Jan 2022 10:28:19 -0500 (EST) |
cbaines pushed a commit to branch master
in repository data-service.
commit 5a1b6d41eb35711ef89531e0cbd73dd7223419ec
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Jan 14 15:25:35 2022 +0000
Fix chunk-for-each! calling proc when there's nothing to do
---
guix-data-service/utils.scm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm
index 14721b1..0250e42 100644
--- a/guix-data-service/utils.scm
+++ b/guix-data-service/utils.scm
@@ -195,9 +195,11 @@
(map cdr chunks-and-rest)))
(apply proc lsts)))
- (unless (eq? 1
- (length (delete-duplicates
- (map length lsts))))
- (error "lists not equal length"))
+ (let ((list-lengths (map length lsts)))
+ (unless (eq? 1 (length (delete-duplicates list-lengths)))
+ (error "lists not equal length"))
- (do-one-iteration lsts))
+ (unless (eq? 0 (first list-lengths))
+ (do-one-iteration lsts)))
+
+ #t)