substitute: Avoid repeated calls to 'length'.
* guix/scripts/substitute.scm (fetch-narinfos)[update-progress!]: Move 'length' call outside of lambda.
This commit is contained in:
parent
3d3e93b3f9
commit
75a4d86f50
|
@ -601,13 +601,14 @@ if file doesn't exist, and the narinfo otherwise."
|
||||||
(define (fetch-narinfos url paths)
|
(define (fetch-narinfos url paths)
|
||||||
"Retrieve all the narinfos for PATHS from the cache at URL and return them."
|
"Retrieve all the narinfos for PATHS from the cache at URL and return them."
|
||||||
(define update-progress!
|
(define update-progress!
|
||||||
(let ((done 0))
|
(let ((done 0)
|
||||||
|
(total (length paths)))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(display #\cr (current-error-port))
|
(display #\cr (current-error-port))
|
||||||
(force-output (current-error-port))
|
(force-output (current-error-port))
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
(G_ "updating list of substitutes from '~a'... ~5,1f%")
|
(G_ "updating list of substitutes from '~a'... ~5,1f%")
|
||||||
url (* 100. (/ done (length paths))))
|
url (* 100. (/ done total)))
|
||||||
(set! done (+ 1 done)))))
|
(set! done (+ 1 done)))))
|
||||||
|
|
||||||
(define hash-part->path
|
(define hash-part->path
|
||||||
|
|
Loading…
Reference in New Issue