diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-22 18:03:02 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-22 18:03:02 +0100 |
commit | 901af1535f708d391d10e7c116d4a9538b89dac2 (patch) | |
tree | 87a829d5d55e3b4a578e61ccde93da78e5b38004 | |
parent | 34a4b98cf6dbb4a97dda590d16832ffcd196bd3a (diff) | |
download | prosody-901af1535f708d391d10e7c116d4a9538b89dac2.tar.gz prosody-901af1535f708d391d10e7c116d4a9538b89dac2.zip |
util.set: Add set:empty() to discover if the set is the empty set
-rw-r--r-- | util/set.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/util/set.lua b/util/set.lua index 892f1c9d..bb318adf 100644 --- a/util/set.lua +++ b/util/set.lua @@ -91,6 +91,10 @@ function new(list) end end + function set:empty() + return not next(items); + end + if list then set:add_list(list); end |