From a4b721ef3ad44e0f491cb891ed7c2de21e738292 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 9 Mar 2012 08:09:17 -0600 Subject: [PATCH] make some private methods actually be private methods (instead of fields) --- collects/typed-racket/optimizer/tool/tool.rkt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/collects/typed-racket/optimizer/tool/tool.rkt b/collects/typed-racket/optimizer/tool/tool.rkt index 186ed37197..61dc5db939 100644 --- a/collects/typed-racket/optimizer/tool/tool.rkt +++ b/collects/typed-racket/optimizer/tool/tool.rkt @@ -36,7 +36,7 @@ (define highlights '()) (define color-table #f) - (define (highlight-entry l) + (define/private (highlight-entry l) (match l [(report-entry subs start end badness) (let ([color (if (= badness 0) @@ -53,10 +53,15 @@ (apply max (cons 0 (map report-entry-badness report)))) (unless (= max-badness 0) ; no missed opts, color table code would error (set! color-table (make-color-table max-badness))) - (define new-highlights (map highlight-entry report)) - (set! highlights (append new-highlights highlights))) + (define new-highlights + (let loop ([report report]) + (cond + [(null? report) highlights] + [else (cons (highlight-entry (car report)) + (loop (cdr reports)))]))) + (set! highlights new-highlights)) - (define (clear-highlights) + (define/private (clear-highlights) (for ([h (in-list highlights)]) (match h [`(,start ,end . ,rest )