Use vector-fold rather than map to construct input-derivations
This avoids append-map and vector->list so might be faster and use less memory.
This commit is contained in:
parent
edeb89e0cf
commit
59f1a04f4e
1 changed files with 7 additions and 4 deletions
|
|
@ -1190,10 +1190,13 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
|
|||
"insert-missing-derivations: ensure-input-derivations-exist ("
|
||||
log-tag ")")
|
||||
(let ((input-derivations
|
||||
(map
|
||||
derivation-input-derivation
|
||||
(append-map derivation-inputs
|
||||
(vector->list derivations)))))
|
||||
(vector-fold
|
||||
(lambda (_ result drv)
|
||||
(append! (map derivation-input-derivation
|
||||
(derivation-inputs drv))
|
||||
result))
|
||||
'()
|
||||
derivations)))
|
||||
(unless (null? input-derivations)
|
||||
;; Ensure all the input derivations exist
|
||||
(for-each
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue