]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
modsupport.c reuses Py_UNICODE_strlen()
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 29 Sep 2011 02:01:43 +0000 (04:01 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 29 Sep 2011 02:01:43 +0000 (04:01 +0200)
Python/modsupport.c

index 08f50658832f5b67dc3fa6379e50acaf001954af..428914f3788a0dde223db6186016ea112d33f73b 100644 (file)
@@ -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;