aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-22 18:03:02 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-22 18:03:02 +0100
commit901af1535f708d391d10e7c116d4a9538b89dac2 (patch)
tree87a829d5d55e3b4a578e61ccde93da78e5b38004 /util
parent34a4b98cf6dbb4a97dda590d16832ffcd196bd3a (diff)
downloadprosody-901af1535f708d391d10e7c116d4a9538b89dac2.tar.gz
prosody-901af1535f708d391d10e7c116d4a9538b89dac2.zip
util.set: Add set:empty() to discover if the set is the empty set
Diffstat (limited to 'util')
-rw-r--r--util/set.lua4
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