diff options
author | Kim Alvefur <zash@zash.se> | 2016-02-25 22:32:13 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-02-25 22:32:13 +0100 |
commit | 7541fc06b17202b5cc55086094cc6a2ff2da3772 (patch) | |
tree | 7ccb265efe627050006a96bc5ee9686f2de9b958 | |
parent | 3d102843008f7de63b5cabe47891199bf5bb79c9 (diff) | |
download | prosody-7541fc06b17202b5cc55086094cc6a2ff2da3772.tar.gz prosody-7541fc06b17202b5cc55086094cc6a2ff2da3772.zip |
util.template: Use separate variables for source and compiled function [luacheck]
-rw-r--r-- | util/template.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/template.lua b/util/template.lua index f72c4ede..04ebb93d 100644 --- a/util/template.lua +++ b/util/template.lua @@ -67,12 +67,12 @@ end local function create_cloner(stanza, chunkname) local lookup = {}; local name = create_clone_string(stanza, lookup, ""); - local f = "local setmetatable,stanza_mt=...;return function(data)"; + local src = "local setmetatable,stanza_mt=...;return function(data)"; for i=1,#lookup do - f = f.."local _"..i.."="..lookup[i]..";"; + src = src.."local _"..i.."="..lookup[i]..";"; end - f = f.."return "..name..";end"; - local f,err = loadstring(f, chunkname); + src = src.."return "..name..";end"; + local f,err = loadstring(src, chunkname); if not f then error(err); end return f(setmetatable, stanza_mt); end |