From 91036cea81b74b5452e9a581b9ccee173a5772fb Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 21 Sep 2014 00:07:08 -0400 Subject: [PATCH] Random improvement. The thing that caught my eye is the missing `#:cache-keys?' which should really be there. But not too important. (cherry picked from commit eaa6f85054c5c404507e5c9cbab0d3e93f468370) --- .../typed-racket/types/printer.rkt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt index 84dd266598..1de6cd9dad 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt @@ -58,16 +58,12 @@ ;; does t have a type name associated with it currently? ;; has-name : Type -> Maybe[Listof] (define (has-name? t) - (cond - [print-aliases - (define candidates - (for/list ([(n t*) (in-pairs (in-list (force (current-type-names))))] - #:when (and (Type? t*) (type-equal? t t*))) - n)) - (if (null? candidates) - #f - (sort candidates string>? #:key symbol->string))] - [else #f])) + (define candidates + (for/list ([(n t*) (in-pairs (in-list (force (current-type-names))))] + #:when (and print-aliases (Type? t*) (type-equal? t t*))) + n)) + (and (pair? candidates) + (sort candidates string>? #:key symbol->string #:cache-keys? #t))) ;; print- : Output-Port Boolean -> Void ;; print-type also takes an optional (Listof Symbol)