better use of new sort
svn: r11321
This commit is contained in:
parent
0dbc0d472e
commit
156d3364df
|
@ -9,9 +9,9 @@
|
|||
|
||||
;; get-info : (listof path-or-string) -> info/#f
|
||||
(define (get-info coll-path)
|
||||
(let* ([coll-path (map (lambda (x) (if (path? x) (path->string x) x)) coll-path)]
|
||||
[dir (apply collection-path coll-path)])
|
||||
(get-info/full dir)))
|
||||
(let ([coll-path (map (lambda (x) (if (path? x) (path->string x) x))
|
||||
coll-path)])
|
||||
(get-info/full (apply collection-path coll-path))))
|
||||
|
||||
;; get-info/full : path -> info/#f
|
||||
(define (get-info/full dir)
|
||||
|
@ -41,7 +41,7 @@
|
|||
expr ...)
|
||||
;; No need to set a reader-guard, since we checked it
|
||||
;; above (a guard will see other uses of #lang for stuff
|
||||
;; that is required).
|
||||
;; that is required).
|
||||
;; We are, however, trusting that the bytecode form of the
|
||||
;; file (if any) matches the source.
|
||||
(dynamic-require file '#%info-lookup)]
|
||||
|
@ -158,13 +158,9 @@
|
|||
(hash-set! result c #t))
|
||||
;; Extract the relevant collections:
|
||||
(hash-map result (lambda (k v) k))))])
|
||||
(sort unsorted
|
||||
(lambda (a b)
|
||||
(compare-directories (directory-record-path a)
|
||||
(directory-record-path b))))))
|
||||
|
||||
(define (compare-directories a b)
|
||||
(bytes<? (dir->sort-key a) (dir->sort-key b)))
|
||||
(sort unsorted bytes<?
|
||||
#:key (lambda (dr) (dir->sort-key (directory-record-path dr)))
|
||||
#:cache-keys? #t)))
|
||||
|
||||
;; dir->sort-key : path -> bytes
|
||||
;; extracts the name of the directory, dropping any "."s it finds at the ends.
|
||||
|
|
|
@ -383,7 +383,7 @@
|
|||
cleanup))
|
||||
|
||||
(define (sort-collections ccs)
|
||||
(sort ccs (lambda (a b) (string<? (cc-name a) (cc-name b)))))
|
||||
(sort ccs string<? #:key cc-name))
|
||||
|
||||
(define collections-to-compile
|
||||
(sort-collections
|
||||
|
|
Loading…
Reference in New Issue
Block a user