Subject: [PATCH 2/3] guix: derivations: Use delete-duplicates/sort.

From: Christopher Baines <[email-masked]>
Date: Fri, 5 Jan 2024 20:53:21 +0000

As this seems to be a small speedup, as tested by computing derivations for
all packages targeting i586-pc-gnu.

* guix/derivations.scm (derivation/masked-inputs): Use delete-duplicates/sort.

Change-Id: I9ec963c10e67a525037c346f44c92a87376935c5
---
 guix/derivations.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index 9fec7f4f0b..29c7ef9a5c 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -745,10 +745,12 @@ (define (derivation/masked-inputs drv)
                              (make-derivation-input hash sub-drvs))))
                         inputs)))
        (make-derivation outputs
-                        (sort (delete-duplicates inputs)
-                              (lambda (drv1 drv2)
-                                (string<? (derivation-input-derivation drv1)
-                                          (derivation-input-derivation drv2))))
+                        (delete-duplicates/sort
+                         inputs
+                         (lambda (drv1 drv2)
+                           (string<? (derivation-input-derivation drv1)
+                                     (derivation-input-derivation drv2)))
+                         eq?)
                         sources
                         system builder args env-vars
                         #f)))))
-- 
2.41.0