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:
Yury Selivanov 2018-01-26 17:24:52 -05:00 committed by GitHub
parent 43c47fe096
commit 226e50049d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -145,7 +145,8 @@ PyContextVar_Get(PyContextVar *var, PyObject *def, PyObject **val)
{
assert(PyContextVar_CheckExact(var));
PyThreadState *ts = PyThreadState_Get();
PyThreadState *ts = PyThreadState_GET();
assert(ts != NULL);
if (ts->context == NULL) {
goto not_found;
}