diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-08-26 00:44:07 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-08-26 00:44:07 (GMT) |
commit | 454602f0f7a0adf26904b6a700483c9386646788 (patch) | |
tree | 664049d700990a8cdc5c768a4c4d763abf77f7c2 | |
parent | cd06eeb20cff9af7d21c87222e1267b80012ce92 (diff) | |
download | cpython-454602f0f7a0adf26904b6a700483c9386646788.zip cpython-454602f0f7a0adf26904b6a700483c9386646788.tar.gz cpython-454602f0f7a0adf26904b6a700483c9386646788.tar.bz2 |
Gave intersection_update a speed boost.
-rw-r--r-- | Lib/sets.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/sets.py b/Lib/sets.py index e33464b..5007709 100644 --- a/Lib/sets.py +++ b/Lib/sets.py @@ -380,9 +380,7 @@ class Set(BaseSet): def __iand__(self, other): """Update a set with the intersection of itself and another.""" self._binary_sanity_check(other) - for elt in self._data.keys(): - if elt not in other: - del self._data[elt] + self._data = (self & other)._data return self def intersection_update(self, other): |