From 5a1b6d41eb35711ef89531e0cbd73dd7223419ec Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 14 Jan 2022 15:25:35 +0000 Subject: [PATCH] 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)