From: Andy Lester Date: Fri, 21 Feb 2020 04:51:47 +0000 (-0600) Subject: closes bpo-39684: Combine two if/thens and squash uninit var warning. (GH-18565) X-Git-Tag: v3.9.0a4~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=933fc53f3f9c64ffa703b1f23a93bec560faea57;p=thirdparty%2FPython%2Fcpython.git closes bpo-39684: Combine two if/thens and squash uninit var warning. (GH-18565) --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4475eca9432d..ee6d3dfd3945 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -12209,20 +12209,15 @@ PyUnicode_IsIdentifier(PyObject *self) int kind = 0; void *data = NULL; - wchar_t *wstr; + const wchar_t *wstr = NULL; + Py_UCS4 ch; if (ready) { kind = PyUnicode_KIND(self); data = PyUnicode_DATA(self); - } - else { - wstr = _PyUnicode_WSTR(self); - } - - Py_UCS4 ch; - if (ready) { ch = PyUnicode_READ(kind, data, 0); } else { + wstr = _PyUnicode_WSTR(self); ch = wstr[0]; } /* PEP 3131 says that the first character must be in