From 33d52cb3796dcec2f9be4296b4a6ea5a6df84f52 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 30 Sep 2008 20:18:55 +0000 Subject: [PATCH] performance improvement svn: r11916 --- collects/htdp/world.ss | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/collects/htdp/world.ss b/collects/htdp/world.ss index daa3bea1c5..e79d2d6d38 100644 --- a/collects/htdp/world.ss +++ b/collects/htdp/world.ss @@ -918,9 +918,11 @@ Matthew (define m (mouse-event->symbol e)) (when (and (<= 0 x WIDTH) (<= 0 y HEIGHT)) (with-handlers ([exn:break? break-handler][exn? exn-handler]) - (set! the-world (f the-world x y m)) - (add-event MOUSE x y m) - (redraw-callback))))))) + (let ([new-world (f the-world x y m)]) + (unless (eq? new-world the-world) + (set! the-world new-world) + (add-event MOUSE x y m) + (redraw-callback))))))))) ;; MouseEvent -> MouseEventType (define (mouse-event->symbol e)