[Python-checkins] python/dist/src/Lib sets.py,1.28,1.29
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Sun, 25 Aug 2002 17:44:10 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv32108/python/lib
Modified Files:
sets.py
Log Message:
Gave intersection_update a speed boost.
Index: sets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** sets.py 25 Aug 2002 20:12:19 -0000 1.28
--- sets.py 26 Aug 2002 00:44:07 -0000 1.29
***************
*** 381,387 ****
"""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]
return self
--- 381,385 ----
"""Update a set with the intersection of itself and another."""
self._binary_sanity_check(other)
! self._data = (self & other)._data
return self