Author: Alex Gaynor <[email protected]>
Branch: unroll-if-alt
Changeset: r46101:e18517492237
Date: 2011-07-29 23:20 -0700
http://bitbucket.org/pypy/pypy/changeset/e18517492237/

Log:    Special case for length == 1 here, helps the non-jit case as well.

diff --git a/pypy/rpython/lltypesystem/rstr.py 
b/pypy/rpython/lltypesystem/rstr.py
--- a/pypy/rpython/lltypesystem/rstr.py
+++ b/pypy/rpython/lltypesystem/rstr.py
@@ -686,6 +686,10 @@
     @jit.unroll_if(lambda length, items: jit.isconstant(length) and length <= 
2)
     @enforceargs(int, None)
     def ll_join_strs(length, items):
+        # Special case for length 1 items, helps both the JIT and other code
+        if length == 1:
+            return items[0]
+
         num_items = length
         itemslen = 0
         i = 0
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to