Kaydet (Commit) 4c63a972 authored tarafından Victor Stinner's avatar Victor Stinner

Cleanup PyUnicode_FromFormatV() for zero padding

Skip the "0" instead of parsing it twice: detect zero padding and then parsed
as a digit of the width.
üst 15a11365
......@@ -2349,7 +2349,11 @@ unicode_fromformat_arg(_PyUnicodeWriter *writer,
p = f;
f++;
zeropad = (*f == '0');
zeropad = 0;
if (*f == '0') {
zeropad = 1;
f++;
}
/* parse the width.precision part, e.g. "%2.5s" => width=2, precision=5 */
width = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment