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

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sun, 25 Aug 2002 12:50:45 -0700


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

Modified Files:
	sets.py 
Log Message:
Gave __sub__/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.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** sets.py	25 Aug 2002 19:47:54 -0000	1.26
--- sets.py	25 Aug 2002 19:50:43 -0000	1.27
***************
*** 224,230 ****
          result = self.__class__()
          data = result._data
          value = True
          for elt in self:
!             if elt not in other:
                  data[elt] = value
          return result
--- 224,231 ----
          result = self.__class__()
          data = result._data
+         otherdata = other._data
          value = True
          for elt in self:
!             if elt not in otherdata:
                  data[elt] = value
          return result