summaryrefslogtreecommitdiffstats
path: root/Lib/sets.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-08-25 19:50:43 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-08-25 19:50:43 (GMT)
commitb8940393e9be5be09920f28bfea0049e4255354b (patch)
tree242bf9c85dc39c70947d5dd99e6b60f6f9f6404c /Lib/sets.py
parent334b4a5c393fba0b3cf37ed88b36cbd554a24f4f (diff)
downloadcpython-b8940393e9be5be09920f28bfea0049e4255354b.zip
cpython-b8940393e9be5be09920f28bfea0049e4255354b.tar.gz
cpython-b8940393e9be5be09920f28bfea0049e4255354b.tar.bz2
Gave __sub__/difference a factor of 2-5 speed boost.
Diffstat (limited to 'Lib/sets.py')
-rw-r--r--Lib/sets.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/sets.py b/Lib/sets.py
index bf3ff4d..4665373 100644
--- a/Lib/sets.py
+++ b/Lib/sets.py
@@ -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