derivations: Improve complexity of 'substitution-oracle'.

* guix/derivations.scm (substitution-oracle): Use a final 'concatenate'
  instead of repeated 'append's.
This commit is contained in:
Ludovic Courtès 2015-07-22 18:31:51 +02:00
parent 1bd4e6db15
commit b59df2434a
1 changed files with 10 additions and 10 deletions

View File

@ -264,16 +264,16 @@ substituter many times."
(derivation-prerequisites drv valid-input?))) (derivation-prerequisites drv valid-input?)))
(let* ((paths (delete-duplicates (let* ((paths (delete-duplicates
(concatenate
(fold (lambda (drv result) (fold (lambda (drv result)
(let ((self (match (derivation->output-paths drv) (let ((self (match (derivation->output-paths drv)
(((names . paths) ...) (((names . paths) ...)
paths)))) paths))))
(if (every valid? self) (if (every valid? self)
result result
(append (append self (dependencies drv)) (cons* self (dependencies drv) result))))
result))))
'() '()
drv))) drv))))
(subst (list->set (substitutable-paths store paths)))) (subst (list->set (substitutable-paths store paths))))
(cut set-contains? subst <>))) (cut set-contains? subst <>)))