cache on content and type, not just content

svn: r1084
This commit is contained in:
Matthew Flatt 2005-10-14 14:11:58 +00:00
parent e2e6516a84
commit 0b12dcfd54

View File

@ -46,7 +46,7 @@
(define cached (make-hash-table 'equal)) (define cached (make-hash-table 'equal))
(define (get-or-load-bitmap content orig type) (define (get-or-load-bitmap content orig type)
(hash-table-get cached content (hash-table-get cached (cons content type)
(lambda () (lambda ()
(let ([bm (let ([fn (make-temporary-file)]) (let ([bm (let ([fn (make-temporary-file)])
(dynamic-wind (dynamic-wind
@ -62,5 +62,5 @@
(error 'include-bitmap (error 'include-bitmap
"unable to parse image, originated from: ~a" "unable to parse image, originated from: ~a"
(path->string (bytes->path orig)))) (path->string (bytes->path orig))))
(hash-table-put! cached content bm) (hash-table-put! cached (cons content type) bm)
bm))))) bm)))))