Commits

Anonymous committed 452bb28

optimization for the union of two sets using the object strategy

Comments (0)

Files changed (1)

pypy/objspace/std/setobject.py

 
     def update(self, w_set, w_other):
         d_obj = self.unerase(w_set.sstorage)
+
+        # optimization only
+        if w_other.strategy is self:
+            d_other = self.unerase(w_other.sstorage)
+            d_obj.update(d_other)
+            return
+
         w_iterator = w_other.iter()
         while True:
             w_item = w_iterator.next_entry()