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 ("
|
"insert-missing-derivations: ensure-input-derivations-exist ("
|
||||||
log-tag ")")
|
log-tag ")")
|
||||||
(let ((input-derivations
|
(let ((input-derivations
|
||||||
(map
|
(vector-fold
|
||||||
derivation-input-derivation
|
(lambda (_ result drv)
|
||||||
(append-map derivation-inputs
|
(append! (map derivation-input-derivation
|
||||||
(vector->list derivations)))))
|
(derivation-inputs drv))
|
||||||
|
result))
|
||||||
|
'()
|
||||||
|
derivations)))
|
||||||
(unless (null? input-derivations)
|
(unless (null? input-derivations)
|
||||||
;; Ensure all the input derivations exist
|
;; Ensure all the input derivations exist
|
||||||
(for-each
|
(for-each
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue