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
|
@ -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…
Reference in New Issue