From 16ffa430a111dc293cd9ed899ecf9da3729f58bd Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Fri, 6 Dec 2013 13:19:54 -0800 Subject: [PATCH] Style tweaks --- mustache.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mustache.js b/mustache.js index ef892a1..a03e2e0 100644 --- a/mustache.js +++ b/mustache.js @@ -411,11 +411,14 @@ * that is generated from the parse. */ Writer.prototype.parse = function (template, tags) { - if (!(template in this.cache)) { - this.cache[template] = parseTemplate(template, tags); + var cache = this.cache; + var tokens = cache[template]; + + if (tokens == null) { + tokens = cache[template] = parseTemplate(template, tags); } - return this.cache[template]; + return tokens; }; /**