Changeset

4544:316e2b09a562

util.set: Accept nil to add_list()
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Jan 2012 23:59:19 +0000
parents 4543:db27a4c18b6a
children 4545:c9b91ddc9c11
files util/set.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/set.lua	Sun Jan 22 23:57:13 2012 +0000
+++ b/util/set.lua	Sun Jan 22 23:59:19 2012 +0000
@@ -82,8 +82,10 @@
 	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