mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-32436: Make PyContextVar_Get a little bit faster (#5350)
Since context.c is compiled with Py_BUILD_CORE, using a macro will result in a slightly more optimal code.
This commit is contained in:
parent
43c47fe096
commit
226e50049d
1 changed files with 2 additions and 1 deletions
|
@ -145,7 +145,8 @@ PyContextVar_Get(PyContextVar *var, PyObject *def, PyObject **val)
|
||||||
{
|
{
|
||||||
assert(PyContextVar_CheckExact(var));
|
assert(PyContextVar_CheckExact(var));
|
||||||
|
|
||||||
PyThreadState *ts = PyThreadState_Get();
|
PyThreadState *ts = PyThreadState_GET();
|
||||||
|
assert(ts != NULL);
|
||||||
if (ts->context == NULL) {
|
if (ts->context == NULL) {
|
||||||
goto not_found;
|
goto not_found;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue