Author: Lukas Diekmann <[email protected]>
Branch: set-strategies
Changeset: r49220:94d75f6d8f44
Date: 2011-10-11 14:40 +0200
http://bitbucket.org/pypy/pypy/changeset/94d75f6d8f44/
Log: when updating empty list simply copy storage and strategy from the
other set
diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -284,9 +284,8 @@
w_set.sstorage = w_other.get_storage_copy()
def update(self, w_set, w_other):
- # XXX wouldn't it be faster to just copy the storage of w_other into
self?
- w_set.switch_to_object_strategy(self.space)
- w_set.update(w_other)
+ w_set.strategy = w_other.strategy
+ w_set.storage = w_other.get_storage_copy()
def iter(self, w_set):
return EmptyIteratorImplementation(self.space, w_set)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit