diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-07-10 02:25:14 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-07-10 02:25:14 +0100 |
commit | 825d03cc43430af857fa063094e87644771fa149 (patch) | |
tree | 5206e296e7ea2b04975d81cc89b12b03d3d35bbc /util/stanza.lua | |
parent | d37bfa0073f9a7aeedd370f76963beed535eb1d5 (diff) | |
download | prosody-825d03cc43430af857fa063094e87644771fa149.tar.gz prosody-825d03cc43430af857fa063094e87644771fa149.zip |
util.stanza: Convert spaces to tabs
Diffstat (limited to 'util/stanza.lua')
-rw-r--r-- | util/stanza.lua | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/util/stanza.lua b/util/stanza.lua index 35d600ed..b63fc411 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -177,11 +177,11 @@ end do - local id = 0; - function new_id() - id = id + 1; - return "lx"..id; - end + local id = 0; + function new_id() + id = id + 1; + return "lx"..id; + end end function preserialize(stanza) @@ -226,21 +226,22 @@ function deserialize(stanza) end function clone(stanza) - local lookup_table = {}; - local function _copy(object) - if type(object) ~= "table" then - return object; - elseif lookup_table[object] then - return lookup_table[object]; - end - local new_table = {}; - lookup_table[object] = new_table; - for index, value in pairs(object) do - new_table[_copy(index)] = _copy(value); - end - return setmetatable(new_table, getmetatable(object)); - end - return _copy(stanza) + local lookup_table = {}; + local function _copy(object) + if type(object) ~= "table" then + return object; + elseif lookup_table[object] then + return lookup_table[object]; + end + local new_table = {}; + lookup_table[object] = new_table; + for index, value in pairs(object) do + new_table[_copy(index)] = _copy(value); + end + return setmetatable(new_table, getmetatable(object)); + end + + return _copy(stanza) end function message(attr, body) |