]> granicus.if.org Git - python/commit
Add _PyUnicodeWriter_WriteSubstring() function
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 2 Apr 2013 23:48:39 +0000 (01:48 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 2 Apr 2013 23:48:39 +0000 (01:48 +0200)
commitcfc4c13b04223705a43595579b46020c9e876ac4
tree238b3c5e9e2ac723e86fa2b3eb711cd5eb45eebf
parent4489e927a6e030f19fee77783ebb209119f4ad60
Add _PyUnicodeWriter_WriteSubstring() function

Write a function to enable more optimizations:

 * If the substring is the whole string and overallocation is disabled, just
   keep a reference to the string, don't copy characters
 * Avoid a call to the expensive _PyUnicode_FindMaxChar() function when
   possible
Include/unicodeobject.h
Lib/test/test_format.py
Objects/stringlib/unicode_format.h
Objects/unicodeobject.c