Merge Tobias's fancy SASL branch->trunk
[prosody.git] / util / set.lua
index bb318adf5290a207d41c3c7f0a2144acf4dd2dcd..ee154ece11e1f5977be607735fa197acf10de4e4 100644 (file)
@@ -1,3 +1,11 @@
+-- Prosody IM
+-- Copyright (C) 2008-2010 Matthew Wild
+-- Copyright (C) 2008-2010 Waqas Hussain
+-- 
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
 local ipairs, pairs, setmetatable, next, tostring = 
       ipairs, pairs, setmetatable, next, tostring;
 local t_concat = table.concat;
@@ -141,4 +149,8 @@ function intersection(set1, set2)
        return set;
 end
 
+function xor(set1, set2)
+       return union(set1, set2) - intersection(set1, set2);
+end
+
 return _M;