Browse files

Memoize is bult in

  • Loading branch information...
1 parent 356ce30 commit acf86441e4a2830f19bc22d583428b5fc2d2a6a7 @apage43 committed Oct 22, 2012
Showing with 1 addition and 8 deletions.
  1. +1 −8 src/clojure/data/xml.clj
View
9 src/clojure/data/xml.clj
@@ -284,14 +284,7 @@
(.setProperty fac prop v))
fac))
-(def factorycache (atom {}))
-
-(defn xml-input-factory [props]
- (let [cached (@factorycache props)]
- (if cached cached
- (let [newfact (new-xml-input-factory props)]
- (swap! factorycache assoc props newfact)
- newfact))))
+(def xml-input-factory (memoize new-xml-input-factory))
(defn source-seq
"Parses the XML InputSource source using a pull-parser. Returns

0 comments on commit acf8644

Please sign in to comment.