simple fix to deal with performance problem noticed by jpr (this is not a complete fix, but should work in the common case of lots of repeated place-image calls)

svn: r17783
This commit is contained in:
Robby Findler 2010-01-23 20:36:54 +00:00
parent 69482b3ceb
commit 3c1d7e9aca

View File

@ -387,7 +387,16 @@ has been moved out).
(let loop ([crops crops])
(cond
[(null? crops) shape]
[else (make-crop (car crops) (loop (cdr crops)))])))
[(null? (cdr crops))
(make-crop (car crops) shape)]
[else
(let ([fst (car crops)]
[snd (cadr crops)])
(cond
[(equal? fst snd)
(loop (cdr crops))]
[else
(make-crop (car crops) (loop (cdr crops)))]))])))
(cond
[(translate? shape)
(loop (translate-shape shape)