mirror of https://github.com/python/cpython
Gave __sub__/difference a factor of 2-5 speed boost.
This commit is contained in:
parent
334b4a5c39
commit
b8940393e9
|
@ -223,9 +223,10 @@ class BaseSet(object):
|
|||
return NotImplemented
|
||||
result = self.__class__()
|
||||
data = result._data
|
||||
otherdata = other._data
|
||||
value = True
|
||||
for elt in self:
|
||||
if elt not in other:
|
||||
if elt not in otherdata:
|
||||
data[elt] = value
|
||||
return result
|
||||
|
||||
|
|
Loading…
Reference in New Issue