diff options
author | Matthew Wild <mwild1@gmail.com> | 2021-05-13 11:17:13 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2021-05-13 11:17:13 +0100 |
commit | 5bc8b2a379e21901429e4d7f5e10e424ca85e403 (patch) | |
tree | dc46f3423a4319e09fe85402fa76f15568ad89d1 /util/set.lua | |
parent | 37ad3b8fb2039684273b3cb63b5b573e879b04d7 (diff) | |
parent | a95576d485eda2a273b4d66c4c2b363f88c5c43a (diff) | |
download | prosody-5bc8b2a379e21901429e4d7f5e10e424ca85e403.tar.gz prosody-5bc8b2a379e21901429e4d7f5e10e424ca85e403.zip |
Merge 0.11->trunk
Diffstat (limited to 'util/set.lua')
-rw-r--r-- | util/set.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/set.lua b/util/set.lua index 827a9158..7e600ebd 100644 --- a/util/set.lua +++ b/util/set.lua @@ -32,6 +32,11 @@ function set_mt:__freeze() return a; end +local function is_set(o) + local mt = getmetatable(o); + return mt == set_mt; +end + local function new(list) local items = setmetatable({}, items_mt); local set = { _items = items }; @@ -177,6 +182,7 @@ end return { new = new; + is_set = is_set; union = union; difference = difference; intersection = intersection; |