Software /
code /
prosody
Comparison
util/set.lua @ 1030:a82268d507fc
util.set: Add set.xor() to get a set consisting of items not in both sets
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 22 Apr 2009 18:03:42 +0100 |
parent | 1029:4ead03974759 |
child | 1522:569d58d21612 |
comparison
equal
deleted
inserted
replaced
1029:4ead03974759 | 1030:a82268d507fc |
---|---|
139 end | 139 end |
140 | 140 |
141 return set; | 141 return set; |
142 end | 142 end |
143 | 143 |
144 function xor(set1, set2) | |
145 return union(set1, set2) - intersection(set1, set2); | |
146 end | |
147 | |
144 return _M; | 148 return _M; |