projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5d38fe
)
util.set: Add set:empty() to discover if the set is the empty set
author
Matthew Wild
<mwild1@gmail.com>
Wed, 22 Apr 2009 17:03:02 +0000
(18:03 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 22 Apr 2009 17:03:02 +0000
(18:03 +0100)
util/set.lua
patch
|
blob
|
history
diff --git
a/util/set.lua
b/util/set.lua
index 892f1c9d3f70e14bc75a3d36df9ebdcd98531078..bb318adf5290a207d41c3c7f0a2144acf4dd2dcd 100644
(file)
--- 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