tidy loop

pull/218/head
Matthew Butterick 5 years ago
parent 0a13cf5cb9
commit d32b24edb5

@ -1 +1 @@
1572980884 1572991275

@ -59,19 +59,15 @@
[wants-parallel-render [wants-parallel-render
(define source-paths (define source-paths
(remove-duplicates (for/fold ([paths paths-in]
(let loop ([paths paths-in]) [acc null]
(match paths #:result (remove-duplicates acc))
[(cons path0 rest) ([i (in-naturals)]
(define paths-to-append #:break (null? paths))
(match (->complete-path path0) (match (->complete-path (car paths))
[(? pagetree-source? pt) (loop (pagetree->paths pt))] [(? pagetree-source? pt) (values (append (pagetree->paths pt) (cdr paths)) acc)]
[path (define sp (->source-path path)) [(? ->source-path sp) #:when (file-exists? sp) (values (cdr paths) (cons sp acc))]
(cond [_ (values (cdr paths) acc)])))
[(and sp (file-exists? sp)) (list sp)]
[else null])]))
(append paths-to-append rest)]
[_ null]))))
(define job-count (define job-count
(match wants-parallel-render (match wants-parallel-render

Loading…
Cancel
Save