From: Tim Peters Date: Mon, 26 Aug 2002 00:44:07 +0000 (+0000) Subject: Gave intersection_update a speed boost. X-Git-Tag: v2.3c1~4285 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=454602f0f7a0adf26904b6a700483c9386646788;p=thirdparty%2FPython%2Fcpython.git Gave intersection_update a speed boost. --- diff --git a/Lib/sets.py b/Lib/sets.py index e33464b58e23..5007709979eb 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):