From: Matthew Wild Date: Wed, 22 Apr 2009 17:03:02 +0000 (+0100) Subject: util.set: Add set:empty() to discover if the set is the empty set X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;ds=sidebyside;h=35d012211b0504a3076bf55e3d02988329d63203;p=prosody.git util.set: Add set:empty() to discover if the set is the empty set --- 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