Unverified Kaydet (Commit) 226e5004 authored tarafından Yury Selivanov's avatar Yury Selivanov Kaydeden (comit) GitHub

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.
üst 43c47fe0
...@@ -145,7 +145,8 @@ PyContextVar_Get(PyContextVar *var, PyObject *def, PyObject **val) ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment