Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r61154:2db1e1e6b77e
Date: 2013-02-12 17:16 -0500
http://bitbucket.org/pypy/pypy/changeset/2db1e1e6b77e/

Log:    (amaury) presize to maxsplit + 1 not maxsplit

diff --git a/rpython/rlib/rstring.py b/rpython/rlib/rstring.py
--- a/rpython/rlib/rstring.py
+++ b/rpython/rlib/rstring.py
@@ -16,7 +16,7 @@
         raise ValueError("empty separator")
 
     if maxsplit > 0:
-        res = newlist_hint(min(maxsplit, len(value)))
+        res = newlist_hint(min(maxsplit + 1, len(value)))
     else:
         res = []
     start = 0
@@ -34,7 +34,7 @@
 
 def rsplit(value, by, maxsplit=-1):
     if maxsplit > 0:
-        res = newlist_hint(min(maxsplit, len(value)))
+        res = newlist_hint(min(maxsplit + 1, len(value)))
     else:
         res = []
     end = len(value)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to