From ddc9d3e953d4643148e2223e9acd03f6be129f58 Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Wed, 16 Jun 2010 16:37:25 -0600 Subject: [PATCH] macro-stepper: simplified partition code original commit: e9a8e92585e029410245f30c218ce8cbebe15fb3 --- .../syntax-browser/partition.rkt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/collects/macro-debugger/syntax-browser/partition.rkt b/collects/macro-debugger/syntax-browser/partition.rkt index 9a44a2f..f9600c0 100644 --- a/collects/macro-debugger/syntax-browser/partition.rkt +++ b/collects/macro-debugger/syntax-browser/partition.rkt @@ -83,22 +83,16 @@ ;; simplified : hash[(listof nat) => nat] (define simplified (make-hash)) - ;; unsimplified : hash[(listof nat) => nat] - (define unsimplified (make-hash)) - ;; next-number : nat (define next-number 0) (define/public (get-partition stx) - (let ([umarks (get-marks stx)]) - (or (hash-ref unsimplified umarks #f) - (let ([smarks (simplify-marks umarks)]) - (or (hash-ref simplified smarks #f) - (let ([n next-number]) - (hash-set! simplified smarks n) - (hash-set! unsimplified umarks n) - (set! next-number (add1 n)) - n)))))) + (let ([marks (simplify-marks (get-marks stx))]) + (or (hash-ref simplified marks #f) + (let ([n next-number]) + (hash-set! simplified marks n) + (set! next-number (add1 n)) + n)))) (define/public (same-partition? a b) (= (get-partition a) (get-partition b)))