aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-22 18:31:51 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-22 22:56:41 +0200
commitb59df2434aafb8604df38662be1b428bd19b80d6 (patch)
tree5b6c2f240c6b97ce50adfc02594d1e9dc28631ba /guix
parent1bd4e6db15025ea7c2caf97bb77cca4eddf5ebea (diff)
downloadgnu-guix-b59df2434aafb8604df38662be1b428bd19b80d6.tar
gnu-guix-b59df2434aafb8604df38662be1b428bd19b80d6.tar.gz
derivations: Improve complexity of 'substitution-oracle'.
* guix/derivations.scm (substitution-oracle): Use a final 'concatenate' instead of repeated 'append's.
Diffstat (limited to 'guix')
-rw-r--r--guix/derivations.scm20
1 files changed, 10 insertions, 10 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index f12127f0ed..d694ccf6d4 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -264,16 +264,16 @@ substituter many times."
(derivation-prerequisites drv valid-input?)))
(let* ((paths (delete-duplicates
- (fold (lambda (drv result)
- (let ((self (match (derivation->output-paths drv)
- (((names . paths) ...)
- paths))))
- (if (every valid? self)
- result
- (append (append self (dependencies drv))
- result))))
- '()
- drv)))
+ (concatenate
+ (fold (lambda (drv result)
+ (let ((self (match (derivation->output-paths drv)
+ (((names . paths) ...)
+ paths))))
+ (if (every valid? self)
+ result
+ (cons* self (dependencies drv) result))))
+ '()
+ drv))))
(subst (list->set (substitutable-paths store paths))))
(cut set-contains? subst <>)))