Gave __sub__/difference a factor of 2-5 speed boost.

This commit is contained in:
Tim Peters 2002-08-25 19:50:43 +00:00
parent 334b4a5c39
commit b8940393e9

View file

@ -223,9 +223,10 @@ class BaseSet(object):
return NotImplemented return NotImplemented
result = self.__class__() result = self.__class__()
data = result._data data = result._data
otherdata = other._data
value = True value = True
for elt in self: for elt in self:
if elt not in other: if elt not in otherdata:
data[elt] = value data[elt] = value
return result return result