projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35d0122
)
util.set: Add set.xor() to get a set consisting of items not in both sets
author
Matthew Wild
<mwild1@gmail.com>
Wed, 22 Apr 2009 17:03:42 +0000
(18:03 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 22 Apr 2009 17:03:42 +0000
(18:03 +0100)
util/set.lua
patch
|
blob
|
history
diff --git
a/util/set.lua
b/util/set.lua
index bb318adf5290a207d41c3c7f0a2144acf4dd2dcd..84bfe8c42c299e29bcb506ab153198b5677f91b0 100644
(file)
--- a/
util/set.lua
+++ b/
util/set.lua
@@
-141,4
+141,8
@@
function intersection(set1, set2)
return set;
end
+function xor(set1, set2)
+ return union(set1, set2) - intersection(set1, set2);
+end
+
return _M;