From 825d03cc43430af857fa063094e87644771fa149 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 10 Jul 2009 02:25:14 +0100 Subject: util.stanza: Convert spaces to tabs --- util/stanza.lua | 41 +++++++++++++++++++++-------------------- 1 file 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) -- cgit v1.2.3