[Python-checkins] python/dist/src/Lib sets.py,1.25,1.26

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sun, 25 Aug 2002 12:47:56 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv9779/python/lib

Modified Files:
	sets.py 
Log Message:
Gave __xor__/symmetric_difference a factor of 2-5 speed boost.


Index: sets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** sets.py	25 Aug 2002 19:21:27 -0000	1.25
--- sets.py	25 Aug 2002 19:47:54 -0000	1.26
***************
*** 198,206 ****
          data = result._data
          value = True
!         for elt in self:
!             if elt not in other:
                  data[elt] = value
!         for elt in other:
!             if elt not in self:
                  data[elt] = value
          return result
--- 198,208 ----
          data = result._data
          value = True
!         selfdata = self._data
!         otherdata = other._data
!         for elt in selfdata:
!             if elt not in otherdata:
                  data[elt] = value
!         for elt in otherdata:
!             if elt not in selfdata:
                  data[elt] = value
          return result