mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Use macro versions instead of function versions when we already know the type.
This will hopefully get rid of some Coverity warnings, be a hint to developers, and be marginally faster. Some asserts were added when the type is currently known, but depends on values from another function.
This commit is contained in:
parent
70f05c5d7f
commit
2aa9a5dfdd
7 changed files with 19 additions and 16 deletions
|
@ -711,7 +711,9 @@ tok_stdin_decode(struct tok_state *tok, char **inp)
|
|||
if (utf8 == NULL)
|
||||
goto error_clear;
|
||||
|
||||
converted = new_string(PyString_AsString(utf8), PyString_Size(utf8));
|
||||
assert(PyString_Check(utf8));
|
||||
converted = new_string(PyString_AS_STRING(utf8),
|
||||
PyString_GET_SIZE(utf8));
|
||||
Py_DECREF(utf8);
|
||||
if (converted == NULL)
|
||||
goto error_nomem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue