Commit 8474f01c authored by Walter Dörwald's avatar Walter Dörwald

Simplify %U handling by using Py_UNICODE_COPY.

parent 944cb996
......@@ -690,11 +690,9 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
case 'U':
{
PyObject *obj = va_arg(vargs, PyObject *);
Py_UNICODE *ucopy = PyUnicode_AS_UNICODE(obj);
Py_ssize_t usize = PyUnicode_GET_SIZE(obj);
Py_ssize_t upos;
for (upos = 0; upos<usize;)
*s++ = ucopy[upos++];
Py_ssize_t size = PyUnicode_GET_SIZE(obj);
Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size);
s += size;
break;
}
case 'S':
......
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