Diff

util/set.lua @ 4544:316e2b09a562

util.set: Accept nil to add_list()
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Jan 2012 23:59:19 +0000
parent 3540:bc139431830b
child 4908:8c5b5ebaacb0
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