Commit c9c3ace0 authored by Victor Stinner's avatar Victor Stinner

modsupport.c reuses Py_UNICODE_strlen()

parent 6283a7e3
......@@ -148,15 +148,6 @@ do_mklist(const char **p_format, va_list *p_va, int endchar, int n, int flags)
return v;
}
static int
_ustrlen(Py_UNICODE *u)
{
int i = 0;
Py_UNICODE *v = u;
while (*v != 0) { i++; v++; }
return i;
}
static PyObject *
do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags)
{
......@@ -269,7 +260,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
}
else {
if (n < 0)
n = _ustrlen(u);
n = Py_UNICODE_strlen(u);
v = PyUnicode_FromUnicode(u, n);
}
return v;
......
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