mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
closes bpo-39684: Combine two if/thens and squash uninit var warning. (GH-18565)
This commit is contained in:
parent
90930e6545
commit
933fc53f3f
1 changed files with 3 additions and 8 deletions
|
@ -12209,20 +12209,15 @@ PyUnicode_IsIdentifier(PyObject *self)
|
||||||
|
|
||||||
int kind = 0;
|
int kind = 0;
|
||||||
void *data = NULL;
|
void *data = NULL;
|
||||||
wchar_t *wstr;
|
const wchar_t *wstr = NULL;
|
||||||
|
Py_UCS4 ch;
|
||||||
if (ready) {
|
if (ready) {
|
||||||
kind = PyUnicode_KIND(self);
|
kind = PyUnicode_KIND(self);
|
||||||
data = PyUnicode_DATA(self);
|
data = PyUnicode_DATA(self);
|
||||||
}
|
|
||||||
else {
|
|
||||||
wstr = _PyUnicode_WSTR(self);
|
|
||||||
}
|
|
||||||
|
|
||||||
Py_UCS4 ch;
|
|
||||||
if (ready) {
|
|
||||||
ch = PyUnicode_READ(kind, data, 0);
|
ch = PyUnicode_READ(kind, data, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
wstr = _PyUnicode_WSTR(self);
|
||||||
ch = wstr[0];
|
ch = wstr[0];
|
||||||
}
|
}
|
||||||
/* PEP 3131 says that the first character must be in
|
/* PEP 3131 says that the first character must be in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue