projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37faed2
)
Gave __xor__/symmetric_difference a factor of 2-5 speed boost.
author
Tim Peters
<tim.peters@gmail.com>
Sun, 25 Aug 2002 19:47:54 +0000
(19:47 +0000)
committer
Tim Peters
<tim.peters@gmail.com>
Sun, 25 Aug 2002 19:47:54 +0000
(19:47 +0000)
Lib/sets.py
patch
|
blob
|
history
diff --git
a/Lib/sets.py
b/Lib/sets.py
index 10138fca5e1a418902f0b51a30f4565e04144de8..bf3ff4df5ea767db036dbc1025df0bfd3ec0e423 100644
(file)
--- a/
Lib/sets.py
+++ b/
Lib/sets.py
@@
-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 other
data
:
+ if elt not in self
data
:
data[elt] = value
return result