diff options
Diffstat (limited to 'util/multitable.lua')
-rw-r--r-- | util/multitable.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/util/multitable.lua b/util/multitable.lua index dbf34d28..7a2d2b2a 100644 --- a/util/multitable.lua +++ b/util/multitable.lua @@ -1,7 +1,7 @@ -- Prosody IM -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -10,7 +10,7 @@ local select = select; local t_insert = table.insert; local unpack, pairs, next, type = unpack, pairs, next, type; -module "multitable" +local _ENV = nil; local function get(self, ...) local t = self.data; @@ -126,7 +126,7 @@ local function search_add(self, results, ...) return results; end -function iter(self, ...) +local function iter(self, ...) local query = { ... }; local maxdepth = select("#", ...); local stack = { self.data }; @@ -161,7 +161,7 @@ function iter(self, ...) return it, self; end -function new() +local function new() return { data = {}; get = get; @@ -174,4 +174,7 @@ function new() }; end -return _M; +return { + iter = iter; + new = new; +}; |