mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
Optimize _PyUnicode_FastCopyCharacters() when maxchar(from) > maxchar(to)
This commit is contained in:
parent
f05e17ece9
commit
c9d369f1bf
2 changed files with 79 additions and 57 deletions
|
@ -786,8 +786,10 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format,
|
|||
goto done;
|
||||
|
||||
/* Then the source string. */
|
||||
_PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
|
||||
value, 0, len);
|
||||
if (len) {
|
||||
_PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
|
||||
value, 0, len);
|
||||
}
|
||||
writer->pos += (len + rpad);
|
||||
result = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue