From d56f23e769d239a76c5b31a7c2f49fa6d1027730 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Thu, 17 Apr 2014 07:33:45 -0700 Subject: [PATCH] Save local reference to cache --- mustache.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mustache.js b/mustache.js index 6371f1a..46faf3e 100644 --- a/mustache.js +++ b/mustache.js @@ -358,9 +358,11 @@ * up the context hierarchy if the value is absent in this context's view. */ Context.prototype.lookup = function (name) { + var cache = this.cache; + var value; - if (name in this.cache) { - value = this.cache[name]; + if (name in cache) { + value = cache[name]; } else { var context = this, names, index; @@ -382,7 +384,7 @@ context = context.parent; } - this.cache[name] = value; + cache[name] = value; } if (isFunction(value))