util.stanza: Optimisation, remove useless if...then in stanza:children() iterator
[prosody.git] / util / ztact.lua
index 55e402110e3536b696357b293dc17c3de02b1fe9..2507bf8e0107fadc90c93cf23de6a522503f7fee 100644 (file)
@@ -1,24 +1,6 @@
--- Prosody IM v0.1
--- Copyright (C) 2008 Matthew Wild
--- Copyright (C) 2008 Waqas Hussain
--- 
--- This program is free software; you can redistribute it and/or
--- modify it under the terms of the GNU General Public License
--- as published by the Free Software Foundation; either version 2
--- of the License, or (at your option) any later version.
--- 
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
--- 
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
---
-
-
-
+-- Prosody IM
+-- This file is included with Prosody IM. It has modifications,
+-- which are hereby placed in the public domain.
 
 -- public domain 20080410 lua@ztact.com
 
@@ -132,7 +114,7 @@ function tohex (s)    -- - - - - - - - - - - - - - - - - - - - - - - - -  tohex
 
 function tostring_r (d, indent, tab0)    -- - - - - - - - - - - - -  tostring_r
 
-  tab1 = tab0 or {}
+  local tab1 = tab0 or {}
   local rep = string.rep ('  ', indent or 0)
   if type (d) == 'table' then
     for k,v in pairs (d) do
@@ -228,7 +210,7 @@ function enqueue (queue, element)    -- - - - - - - - - - - - - - - - - enqueue
 
 
 local function test_queue ()
-  t = {}
+  local t = {}
   enqueue (t, 1)
   enqueue (t, 2)
   enqueue (t, 3)