{quick,merge}sort -> sort
svn: r2569 original commit: 16f01a1109691d2fa4844b9411410f4794cf0dc1
This commit is contained in:
parent
263da4105f
commit
0dddf931d8
|
@ -334,22 +334,20 @@
|
|||
(define sort-signature-elems
|
||||
(lambda (elems)
|
||||
(map car
|
||||
(quicksort (map
|
||||
(lambda (ip)
|
||||
(let ([i (car ip)])
|
||||
(cons ip (symbol->string (if (symbol? i)
|
||||
i
|
||||
(signature-name i))))))
|
||||
elems)
|
||||
;; Less-than; put subs at front
|
||||
(lambda (a b)
|
||||
(if (symbol? (caar a))
|
||||
(if (symbol? (caar b))
|
||||
(string<? (cdr a) (cdr b))
|
||||
#f)
|
||||
(if (symbol? (caar b))
|
||||
#t
|
||||
(string<? (cdr a) (cdr b)))))))))
|
||||
(sort (map (lambda (ip)
|
||||
(let ([i (car ip)])
|
||||
(cons ip (symbol->string
|
||||
(if (symbol? i) i (signature-name i))))))
|
||||
elems)
|
||||
;; Less-than; put subs at front
|
||||
(lambda (a b)
|
||||
(if (symbol? (caar a))
|
||||
(if (symbol? (caar b))
|
||||
(string<? (cdr a) (cdr b))
|
||||
#f)
|
||||
(if (symbol? (caar b))
|
||||
#t
|
||||
(string<? (cdr a) (cdr b)))))))))
|
||||
|
||||
(define flatten-signature
|
||||
(lambda (id sig main-ctx)
|
||||
|
|
|
@ -675,10 +675,8 @@
|
|||
(hash-table-for-each cycle
|
||||
(lambda (k v)
|
||||
(hash-table-put! share k v)))
|
||||
(let ([ordered (map car
|
||||
(mergesort (hash-table-map share cons)
|
||||
(lambda (a b)
|
||||
(< (cdr a) (cdr b)))))])
|
||||
(let ([ordered (map car (sort (hash-table-map share cons)
|
||||
(lambda (a b) (< (cdr a) (cdr b)))))])
|
||||
(let ([serializeds (map (lambda (v)
|
||||
(if (hash-table-get cycle v (lambda () #f))
|
||||
;; Box indicates cycle record allocation
|
||||
|
@ -693,9 +691,8 @@
|
|||
(cons n
|
||||
(serialize-one v share #f mod-map mod-map-cache))))]
|
||||
[main-serialized (serialize-one v share #t mod-map mod-map-cache)]
|
||||
[mod-map-l (map car
|
||||
(mergesort (hash-table-map mod-map cons)
|
||||
(lambda (a b) (< (cdr a) (cdr b)))))])
|
||||
[mod-map-l (map car (sort (hash-table-map mod-map cons)
|
||||
(lambda (a b) (< (cdr a) (cdr b)))))])
|
||||
(list (hash-table-count mod-map)
|
||||
mod-map-l
|
||||
(length serializeds)
|
||||
|
|
Loading…
Reference in New Issue
Block a user