From 7b949c176f2df988fc41ad0daec0d7bfedca8fff Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 2 Mar 2014 13:54:45 -0500 Subject: [PATCH] update get-compiled-template to use caching instead of always compiling --- src/clj_jtwig/core.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/clj_jtwig/core.clj b/src/clj_jtwig/core.clj index d0bfd88..722dfa2 100644 --- a/src/clj_jtwig/core.clj +++ b/src/clj_jtwig/core.clj @@ -65,7 +65,10 @@ (defn- get-compiled-template [^File file] (if-not (.exists file) (throw (new FileNotFoundException (str "Template file \"" file "\" not found."))) - (compile-template-file file))) + (get-cached-compiled-template + file + (fn [file] + (compile-template-file file))))) (defn- create-function-repository [] (new DefaultFunctionRepository (make-array JtwigFunction 0)))