[pypy-commit] pypy default: one less copy for slice with step

cfbolz pypy.commits at gmail.com
Sun Sep 15 08:16:46 EDT 2019


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: 
Changeset: r97481:db05162bc519
Date: 2019-09-15 14:16 +0200
http://bitbucket.org/pypy/pypy/changeset/db05162bc519/

Log:	one less copy for slice with step

diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -726,7 +726,7 @@
         i = 0
         while True:
             next_pos = rutf8.next_codepoint_pos(self._utf8, byte_pos)
-            builder.append(self._utf8[byte_pos:next_pos])
+            builder.append_slice(self._utf8, byte_pos, next_pos)
             if i == sl - 1:
                 break
             i += 1


More information about the pypy-commit mailing list