guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Ludovic Courtès
Date: Thu, 1 Mar 2018 11:31:44 -0500 (EST)

branch: master
commit 36d7c93119d84eb4b2949ebbab1b19941c4049d1
Author: Ludovic Courtès <address@hidden>
Date:   Thu Mar 1 15:44:40 2018 +0100

    database: Adjust style of 'assqx-ref'.
    
    * src/cuirass/database.scm (db-get-builds)[assqx-ref]: Rewrite with
    'match'.
---
 src/cuirass/database.scm | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 751b8ef..147028e 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -373,12 +373,13 @@ FILTERS is an assoc list which possible keys are 'project 
| 'jobset | 'job |
 
   ;; XXX Change caller and remove
   (define (assqx-ref filters key)
-    (if (null? filters)
-        #f
-        (match (car filters)
-         ((xkey xvalue) (if (eq? key xkey)
-                            xvalue
-                            (assqx-ref (cdr filters) key))))))
+    (match filters
+      (()
+       #f)
+      (((xkey xvalue) rest ...)
+       (if (eq? key xkey)
+           xvalue
+           (assqx-ref rest key)))))
 
   (define (format-output name path)
    `(,name . ((#:path . ,path))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]