Author: Lukas Diekmann <lukas.diekm...@uni-duesseldorf.de>
Branch: set-strategies
Changeset: r51291:a4bba3dd3493
Date: 2012-01-12 18:29 +0100
http://bitbucket.org/pypy/pypy/changeset/a4bba3dd3493/

Log:    merge

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
@@ -943,8 +943,9 @@
         w_set.sstorage = strategy.get_empty_storage()
         return
 
-    #XXX check ints and strings at once
+    _pick_correct_strategy(space, w_set, iterable_w)
 
+def _pick_correct_strategy(space, w_set, iterable_w):
     # check for integers
     for w_item in iterable_w:
         if type(w_item) is not W_IntObject:
diff --git a/pypy/objspace/std/stringobject.py 
b/pypy/objspace/std/stringobject.py
--- a/pypy/objspace/std/stringobject.py
+++ b/pypy/objspace/std/stringobject.py
@@ -61,7 +61,12 @@
         return plain_str2unicode(space, w_self._value)
 
     def listview_str(w_self):
-        return [s for s in w_self._value]
+        return _create_list_from_string(w_self._value)
+
+def _create_list_from_string(value):
+    # need this helper function to allow the jit to look inside and inline
+    # listview_str
+    return [s for s in value]
 
 registerimplementation(W_StringObject)
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to