aboutsummaryrefslogtreecommitdiffstats
path: root/util/set.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-01-22 23:59:19 +0000
committerMatthew Wild <mwild1@gmail.com>2012-01-22 23:59:19 +0000
commit72f03580e8be39593ed6a37c8630e572807f0864 (patch)
tree949bf8ecd834956f10ffd0e9203692cc0ab756a4 /util/set.lua
parent70b25deb380e7ce510cb9ff1b0be2cd579d28692 (diff)
downloadprosody-72f03580e8be39593ed6a37c8630e572807f0864.tar.gz
prosody-72f03580e8be39593ed6a37c8630e572807f0864.zip
util.set: Accept nil to add_list()
Diffstat (limited to 'util/set.lua')
-rw-r--r--util/set.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/set.lua b/util/set.lua
index e4cc2dff..050446ec 100644
--- a/util/set.lua
+++ b/util/set.lua
@@ -82,8 +82,10 @@ function new(list)
end
function set:add_list(list)
- for _, item in ipairs(list) do
- items[item] = true;
+ if list then
+ for _, item in ipairs(list) do
+ items[item] = true;
+ end
end
end