make DrRacket cache path->pkg calls within a single 'Run'

This commit is contained in:
Robby Findler 2014-03-27 07:42:37 -05:00
parent 41ea8f3358
commit 093fba97d9

View File

@ -85,12 +85,13 @@
(define skip-path? (define skip-path?
(let* ([cd (find-collects-dir)] (let* ([cd (find-collects-dir)]
[sd (find-share-dir)] [sd (find-share-dir)]
[path->pkg-cache (make-hash)]
[no-dirs (append [no-dirs (append
(list (CACHE-DIR)) (list (CACHE-DIR))
(if cd (list cd) null) (if cd (list cd) null)
(if sd (list sd) null))]) (if sd (list sd) null))])
(λ (p) (or (file-stamp-in-paths p no-dirs) (λ (p) (or (file-stamp-in-paths p no-dirs)
(let ([pkg (path->pkg p)]) (let ([pkg (path->pkg p path->pkg-cache)])
(and pkg (and pkg
(not (set-member? open-pkgs pkg)) (not (set-member? open-pkgs pkg))
(file-stamp-in-paths p (list (pkg-directory pkg))))))))) (file-stamp-in-paths p (list (pkg-directory pkg)))))))))