diff options
author | Christopher Baines <mail@cbaines.net> | 2022-09-17 15:10:36 +0200 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-09-17 15:10:36 +0200 |
commit | 14a594a114ea7bb7a53f7a3d1333486348e8b0c0 (patch) | |
tree | 94e50aed8ab27657da689cb80549f579e27d6a9d | |
parent | 73645e3d9f419bda600b03cb2470922840bd674c (diff) | |
download | qa-frontpage-14a594a114ea7bb7a53f7a3d1333486348e8b0c0.tar qa-frontpage-14a594a114ea7bb7a53f7a3d1333486348e8b0c0.tar.gz |
Improve the performance of the derivation changes procedures
By incorporating the changes made in the branch module.
-rw-r--r-- | guix-qa-frontpage/derivation-changes.scm | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/guix-qa-frontpage/derivation-changes.scm b/guix-qa-frontpage/derivation-changes.scm index 804fb94..ecfb781 100644 --- a/guix-qa-frontpage/derivation-changes.scm +++ b/guix-qa-frontpage/derivation-changes.scm @@ -30,7 +30,7 @@ "") (let ((system (assoc-ref change "system"))) `((,system - . ,(append + . ,(append! (map (lambda (build) `(,@build @@ -59,25 +59,18 @@ (assoc-ref b "version")))) (define (group-builds-by-package builds) - (fold - (lambda (build result) - (let ((package (assoc-ref build "package"))) - `((,package . ,(cons - build - (or - (and=> (find (match-lambda - ((p . _) - (package-eq? p package))) - result) - cdr) - '()))) - ,@(remove - (match-lambda - ((p . _) - (package-eq? p package))) - result)))) - '() - builds)) + (let ((result (make-hash-table))) + (for-each + (lambda (build) + (let ((package (assoc-ref build "package"))) + (hash-set! result + package + (cons build + (or (hash-ref result package) + '()))))) + builds) + + (hash-map->list cons result))) (define systems (map car builds-by-system)) @@ -121,6 +114,3 @@ (filter (lambda (system) (not (member system systems))) all-systems))))) - - - |