diff options
author | Kim Alvefur <zash@zash.se> | 2015-02-21 10:36:37 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-02-21 10:36:37 +0100 |
commit | 3015aac8bcb38ed2d00b8f5205bd54d82b96e71a (patch) | |
tree | f7609b77dfead0a8d6994597c5799196676080bd /util/multitable.lua | |
parent | 2b0b78b8b0210906d14f52f70fffefac2a744dba (diff) | |
download | prosody-3015aac8bcb38ed2d00b8f5205bd54d82b96e71a.tar.gz prosody-3015aac8bcb38ed2d00b8f5205bd54d82b96e71a.zip |
util.*: Remove use of module() function, make all module functions local and return them in a table at the end
Diffstat (limited to 'util/multitable.lua')
-rw-r--r-- | util/multitable.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/util/multitable.lua b/util/multitable.lua index caf25118..7a2d2b2a 100644 --- a/util/multitable.lua +++ b/util/multitable.lua @@ -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; +}; |