X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fset.lua;h=e4cc2dffbd428b6be84c2ec749ba0cd2156b67b3;hb=e2615fb00f14ddcb436afd00c7729e1135667d42;hp=bb318adf5290a207d41c3c7f0a2144acf4dd2dcd;hpb=35d012211b0504a3076bf55e3d02988329d63203;p=prosody.git diff --git a/util/set.lua b/util/set.lua index bb318adf..e4cc2dff 100644 --- a/util/set.lua +++ b/util/set.lua @@ -1,4 +1,12 @@ -local ipairs, pairs, setmetatable, next, tostring = +-- 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;