Mercurial > cpython-lru_cache-weakref
diff Python/modsupport.c @ 72519:204d9391889a
modsupport.c reuses Py_UNICODE_strlen()
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Thu, 29 Sep 2011 04:01:43 +0200 |
| parents | 2d6d75eaf98c |
| children |
line wrap: on
line diff
--- a/Python/modsupport.c Thu Sep 29 03:28:17 2011 +0200 +++ b/Python/modsupport.c Thu Sep 29 04:01:43 2011 +0200 @@ -148,15 +148,6 @@ 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 @@ } else { if (n < 0) - n = _ustrlen(u); + n = Py_UNICODE_strlen(u); v = PyUnicode_FromUnicode(u, n); } return v;
