From: Victor Stinner Date: Thu, 29 Sep 2011 02:01:43 +0000 (+0200) Subject: modsupport.c reuses Py_UNICODE_strlen() X-Git-Tag: v3.3.0a1~1446 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9c563e84d358346fb2abf09addfdc6e8b7c0c99;p=thirdparty%2FPython%2Fcpython.git modsupport.c reuses Py_UNICODE_strlen() --- diff --git a/Python/modsupport.c b/Python/modsupport.c index 08f50658832f..428914f3788a 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -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;