refac loop

pull/218/head
Matthew Butterick 5 years ago
parent bc86b3632d
commit 8fa727d140

@ -1 +1 @@
1572993457 1572993582

@ -59,15 +59,12 @@
[wants-parallel-render [wants-parallel-render
(define source-paths (define source-paths
(for/fold ([paths paths-in] (let loop ([paths paths-in] [acc null])
[acc null] (match (and (pair? paths) (->complete-path (car paths)))
#:result (remove-duplicates acc)) [#false (remove-duplicates acc)]
([i (in-naturals)] [(? pagetree-source? pt) (loop (append (pagetree->paths pt) (cdr paths)) acc)]
#:break (null? paths)) [(app ->source-path (and (not #false) (? file-exists?) sp)) (loop (cdr paths) (cons sp acc))]
(match (->complete-path (car paths)) [_ (loop (cdr paths) acc)])))
[(? pagetree-source? pt) (values (append (pagetree->paths pt) (cdr paths)) acc)]
[(app ->source-path (and (not #false) (? file-exists?) sp)) (values (cdr paths) (cons sp acc))]
[_ (values (cdr paths) acc)])))
(define job-count (define job-count
(match wants-parallel-render (match wants-parallel-render

Loading…
Cancel
Save