summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/template.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-06-23 23:03:38 +0000
committerSteven Barth <steven@midlink.org>2008-06-23 23:03:38 +0000
commitcd0eaf00057695e74c528757d0209a5d845a2c1b (patch)
tree4a0d406dc304ee1f1932a148861e86601994b3ae /libs/web/luasrc/template.lua
parent623eb2648635273153988d94b1ac38f9bbe892b0 (diff)
* libs/web: Changed caching behaviour of template library
Diffstat (limited to 'libs/web/luasrc/template.lua')
-rw-r--r--libs/web/luasrc/template.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua
index 29aedcdad..f7dcb5602 100644
--- a/libs/web/luasrc/template.lua
+++ b/libs/web/luasrc/template.lua
@@ -128,15 +128,12 @@ Template = luci.util.class()
-- Shared template cache to store templates in to avoid unnecessary reloading
Template.cache = {}
+setmetatable(Template.cache, {__mode = "v"})
-- Constructor - Reads and compiles the template on-demand
function Template.__init__(self, name)
- if self.cache[name] then
- self.template = self.cache[name]
- else
- self.template = nil
- end
+ self.template = self.cache[name]
-- Create a new namespace for this template
self.viewns = {}