cache on content and type, not just content
svn: r1084
This commit is contained in:
parent
e2e6516a84
commit
0b12dcfd54
|
@ -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)))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user