mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-126469: remove unnecessary error-checking branch in lexer.c
(#126473)
This commit is contained in:
parent
a327810169
commit
c810ed7c8e
1 changed files with 1 additions and 5 deletions
|
@ -329,11 +329,7 @@ verify_identifier(struct tok_state *tok)
|
|||
return 0;
|
||||
}
|
||||
Py_ssize_t invalid = _PyUnicode_ScanIdentifier(s);
|
||||
if (invalid < 0) {
|
||||
Py_DECREF(s);
|
||||
tok->done = E_ERROR;
|
||||
return 0;
|
||||
}
|
||||
assert(invalid >= 0);
|
||||
assert(PyUnicode_GET_LENGTH(s) > 0);
|
||||
if (invalid < PyUnicode_GET_LENGTH(s)) {
|
||||
Py_UCS4 ch = PyUnicode_READ_CHAR(s, invalid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue