util.stanza: Optimisation, remove useless if...then in stanza:children() iterator
[prosody.git] / util / ztact.lua
index 15bcffad6c0a7ef8911d62b2ffe549c808d9b6cc..2507bf8e0107fadc90c93cf23de6a522503f7fee 100644 (file)
@@ -1,4 +1,6 @@
-
+-- 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
 
@@ -112,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
@@ -208,7 +210,7 @@ function enqueue (queue, element)    -- - - - - - - - - - - - - - - - - enqueue
 
 
 local function test_queue ()
-  t = {}
+  local t = {}
   enqueue (t, 1)
   enqueue (t, 2)
   enqueue (t, 3)