projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
623eb26
)
* libs/web: Changed caching behaviour of template library
author
Steven Barth
<steven@midlink.org>
Mon, 23 Jun 2008 23:03:38 +0000
(23:03 +0000)
committer
Steven Barth
<steven@midlink.org>
Mon, 23 Jun 2008 23:03:38 +0000
(23:03 +0000)
libs/web/luasrc/template.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/template.lua
b/libs/web/luasrc/template.lua
index 29aedcdadd85a467d7d7ff7e20c9d33103d3588d..f7dcb56028ee1c7a570c3b068f336e33f87264a0 100644
(file)
--- 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 = {}