Skip to content

Commit d9c563e

Browse files
author
Victor Stinner
committed
modsupport.c reuses Py_UNICODE_strlen()
1 parent f7b8cb6 commit d9c563e

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Python/modsupport.c

+1-10
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,6 @@ do_mklist(const char **p_format, va_list *p_va, int endchar, int n, int flags)
148148
return v;
149149
}
150150

151-
static int
152-
_ustrlen(Py_UNICODE *u)
153-
{
154-
int i = 0;
155-
Py_UNICODE *v = u;
156-
while (*v != 0) { i++; v++; }
157-
return i;
158-
}
159-
160151
static PyObject *
161152
do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags)
162153
{
@@ -269,7 +260,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
269260
}
270261
else {
271262
if (n < 0)
272-
n = _ustrlen(u);
263+
n = Py_UNICODE_strlen(u);
273264
v = PyUnicode_FromUnicode(u, n);
274265
}
275266
return v;

0 commit comments

Comments
 (0)