summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-29 20:36:45 +0000
committerSteven Barth <steven@midlink.org>2008-08-29 20:36:45 +0000
commit5cfda95377accd59f488868180b17ca86327839d (patch)
tree9dcd87f5e023793c0d8a1a2a0f6a21a2c968b1b8 /libs/web
parent53871726b550c2b193b22c200984876f61de8843 (diff)
Speed up generation of dispatching tree
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/dispatcher.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index 3cfa6c704..6d3661a54 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -449,17 +449,19 @@ end
--- Create a template render dispatching target.
-- @param name Template to be rendered
function template(name)
- require("luci.template")
- return function() luci.template.render(name) end
+ return function()
+ require("luci.template")
+ luci.template.render(name)
+ end
end
--- Create a CBI model dispatching target.
-- @param model CBI model tpo be rendered
function cbi(model)
- require("luci.cbi")
- require("luci.template")
-
return function(...)
+ require("luci.cbi")
+ require("luci.template")
+
local stat, maps = luci.util.copcall(luci.cbi.load, model, ...)
if not stat then
error500(maps)
@@ -485,10 +487,10 @@ end
--- Create a CBI form model dispatching target.
-- @param model CBI form model tpo be rendered
function form(model)
- require("luci.cbi")
- require("luci.template")
-
return function(...)
+ require("luci.cbi")
+ require("luci.template")
+
local stat, maps = luci.util.copcall(luci.cbi.load, model, ...)
if not stat then
error500(maps)