Commit 334b4a5c authored by Tim Peters's avatar Tim Peters

Gave __xor__/symmetric_difference a factor of 2-5 speed boost.

parent 37faed25
......@@ -197,11 +197,13 @@ class BaseSet(object):
result = self.__class__()
data = result._data
value = True
for elt in self:
if elt not in other:
selfdata = self._data
otherdata = other._data
for elt in selfdata:
if elt not in otherdata:
data[elt] = value
for elt in other:
if elt not in self:
for elt in otherdata:
if elt not in selfdata:
data[elt] = value
return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment