mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
modsupport.c reuses Py_UNICODE_strlen()
This commit is contained in:
parent
f7b8cb605d
commit
d9c563e84d
1 changed files with 1 additions and 10 deletions
|
@ -148,15 +148,6 @@ do_mklist(const char **p_format, va_list *p_va, int endchar, int n, int flags)
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
_ustrlen(Py_UNICODE *u)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
Py_UNICODE *v = u;
|
|
||||||
while (*v != 0) { i++; v++; }
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags)
|
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 {
|
else {
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
n = _ustrlen(u);
|
n = Py_UNICODE_strlen(u);
|
||||||
v = PyUnicode_FromUnicode(u, n);
|
v = PyUnicode_FromUnicode(u, n);
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue