mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Gave __sub__/difference a factor of 2-5 speed boost.
This commit is contained in:
parent
334b4a5c39
commit
b8940393e9
1 changed files with 2 additions and 1 deletions
|
|
@ -223,9 +223,10 @@ def __sub__(self, other):
|
|||
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…
Add table
Add a link
Reference in a new issue