Permalink
Browse files

Ensure that the expiration table is initialized properly, otherwise t…

…he base entries live forever. Thanks to @jcrossley for the fix.
  • Loading branch information...
fogus committed Feb 13, 2012
1 parent 8602477 commit 4025b3bb814ab540a0cfa7ad5c18d19b2050e5b6
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/clojure/clojure/core/cache.clj
@@ -100,6 +100,8 @@
Object
(toString [_] (str cache)))
+;; FnCache
+
(defcache FnCache [cache f]
CacheProtocol
(lookup [_ item]
@@ -492,7 +494,7 @@
[ttl base]
{:pre [(number? ttl) (<= 0 ttl)
(map? base)]}
- (TTLCache. base {} ttl))
+ (clojure.core.cache/seed (TTLCache. {} {} ttl) base))
(defn lu-cache-factory
"Returns an LU cache with the cache and usage-table initialied to `base`."

0 comments on commit 4025b3b

Please sign in to comment.