diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-17 18:33:01 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-17 18:33:01 +0000 |
commit | 768bf67b867df0fde2715308eef482cb677a8566 (patch) | |
tree | c9b50b1f984d52fb4c24fa7182bf9afbcdbb884b /libs/web/luasrc | |
parent | 62b2c39a5d7bf67df1c5d483db820673dc3c13aa (diff) |
libs/web: optimize code generation in luci.template
Diffstat (limited to 'libs/web/luasrc')
-rw-r--r-- | libs/web/luasrc/template.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua index 83efd2200..c8f4daa2d 100644 --- a/libs/web/luasrc/template.lua +++ b/libs/web/luasrc/template.lua @@ -24,7 +24,7 @@ limitations under the License. ]]-- -local fs = require"luci.fs" +local fs = require "luci.fs" local sys = require "luci.sys" local util = require "luci.util" local table = require "table" @@ -89,9 +89,9 @@ function compile(template) -- Replacements local r_include = '")\ninclude("%s")\nwrite("' - local r_i18n = '"..translate("%1","%2").."' - local r_i18n2 = '"..translate("%1", "").."' - local r_pexec = '"..(%s or "").."' + local r_i18n = '")\nwrite(translate("%1","%2"))\nwrite("' + local r_i18n2 = '")\nwrite(translate("%1", ""))\nwrite("' + local r_pexec = '")\nwrite(tostring(%s or ""))\nwrite("' local r_exec = '")\n%s\nwrite("' -- Parse the expressions |