Skip to content
Snippets Groups Projects
Commit b59df243 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

derivations: Improve complexity of 'substitution-oracle'.

* guix/derivations.scm (substitution-oracle): Use a final 'concatenate'
  instead of repeated 'append's.
parent 1bd4e6db
No related branches found
No related tags found
No related merge requests found
......@@ -264,16 +264,16 @@ (define (dependencies drv)
(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 <>)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment