From 0d98ee54b5a332e5d6a42aebf85026da2d432d2f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 22 Apr 2009 18:03:42 +0100 Subject: util.set: Add set.xor() to get a set consisting of items not in both sets --- util/set.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util') diff --git a/util/set.lua b/util/set.lua index bb318adf..84bfe8c4 100644 --- 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; -- cgit v1.2.3