Skip to content

Commit 933fc53

Browse files
authored
closes bpo-39684: Combine two if/thens and squash uninit var warning. (GH-18565)
1 parent 90930e6 commit 933fc53

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Objects/unicodeobject.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12209,20 +12209,15 @@ PyUnicode_IsIdentifier(PyObject *self)
1220912209

1221012210
int kind = 0;
1221112211
void *data = NULL;
12212-
wchar_t *wstr;
12212+
const wchar_t *wstr = NULL;
12213+
Py_UCS4 ch;
1221312214
if (ready) {
1221412215
kind = PyUnicode_KIND(self);
1221512216
data = PyUnicode_DATA(self);
12216-
}
12217-
else {
12218-
wstr = _PyUnicode_WSTR(self);
12219-
}
12220-
12221-
Py_UCS4 ch;
12222-
if (ready) {
1222312217
ch = PyUnicode_READ(kind, data, 0);
1222412218
}
1222512219
else {
12220+
wstr = _PyUnicode_WSTR(self);
1222612221
ch = wstr[0];
1222712222
}
1222812223
/* PEP 3131 says that the first character must be in

0 commit comments

Comments
 (0)