Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1adbc6f commit 821e4cfCopy full SHA for 821e4cf
1 file changed
Objects/unicodeobject.c
@@ -8845,6 +8845,7 @@ fix_decimal_and_space_to_ascii(PyObject *self)
8845
const int kind = PyUnicode_KIND(self);
8846
void *data = PyUnicode_DATA(self);
8847
Py_UCS4 maxchar = 0, ch, fixed;
8848
+ int modified = 0;
8849
Py_ssize_t i;
8850
8851
for (i = 0; i < len; ++i) {
@@ -8859,6 +8860,7 @@ fix_decimal_and_space_to_ascii(PyObject *self)
8859
8860
fixed = '0' + decimal;
8861
}
8862
if (fixed != 0) {
8863
+ modified = 1;
8864
if (fixed > maxchar)
8865
maxchar = fixed;
8866
PyUnicode_WRITE(kind, data, i, fixed);
@@ -8870,7 +8872,7 @@ fix_decimal_and_space_to_ascii(PyObject *self)
8870
8872
maxchar = ch;
8871
8873
8874
- return maxchar;
8875
+ return (modified) ? maxchar : 0;
8876
8877
8878
PyObject *
0 commit comments