summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-02-21 04:51:47 (GMT)
committerGitHub <noreply@github.com>2020-02-21 04:51:47 (GMT)
commit933fc53f3f9c64ffa703b1f23a93bec560faea57 (patch)
treea1aef88d0fef807b6afdd99a1a23cb04b03691fa /Objects
parent90930e65455f60216f09d175586139242dbba260 (diff)
downloadcpython-933fc53f3f9c64ffa703b1f23a93bec560faea57.zip
cpython-933fc53f3f9c64ffa703b1f23a93bec560faea57.tar.gz
cpython-933fc53f3f9c64ffa703b1f23a93bec560faea57.tar.bz2
closes bpo-39684: Combine two if/thens and squash uninit var warning. (GH-18565)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 4475eca..ee6d3df 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