summaryrefslogtreecommitdiffstats
path: root/Python/getcompiler.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-10-06 21:03:36 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-10-06 21:03:36 (GMT)
commite215d960be3c5e1457920c452dc8f94ebf42b159 (patch)
tree6a48506e8fbe03543c0c258aab982c6a6af8558d /Python/getcompiler.c
parent2a09b6e84955779dbc878c5a0679c41d84f5d021 (diff)
downloadcpython-e215d960be3c5e1457920c452dc8f94ebf42b159.zip
cpython-e215d960be3c5e1457920c452dc8f94ebf42b159.tar.gz
cpython-e215d960be3c5e1457920c452dc8f94ebf42b159.tar.bz2
Issue #16147: Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter API
* Simplify the code: replace 4 steps with one unique step using the _PyUnicodeWriter API. PyUnicode_Format() has the same design. It avoids to store intermediate results which require to allocate an array of pointers on the heap. * Use the _PyUnicodeWriter API for speed (and its convinient API): overallocate the buffer to reduce the number of "realloc()" * Implement "width" and "precision" in Python, don't rely on sprintf(). It avoids to need of a temporary buffer allocated on the heap: only use a small buffer allocated in the stack. * Add _PyUnicodeWriter_WriteCstr() function * Split PyUnicode_FromFormatV() into two functions: add unicode_fromformat_arg(). * Inline parse_format_flags(): the format of an argument is now only parsed once, it's no more needed to have a subfunction. * Optimize PyUnicode_FromFormatV() for characters between two "%" arguments: search the next "%" and copy the substring in one chunk, instead of copying character per character.
Diffstat (limited to 'Python/getcompiler.c')
0 files changed, 0 insertions, 0 deletions