Address review: fix performance issue in tee_copy()

This commit is contained in:
Erlend E. Aasland 2021-01-03 10:38:00 +01:00
parent 8d8cd61df0
commit 55cee70766
No known key found for this signature in database
GPG Key ID: E323E17E686C7B5F
1 changed files with 1 additions and 2 deletions

View File

@ -787,8 +787,7 @@ tee_copy(teeobject *to, PyObject *Py_UNUSED(ignored))
{ {
teeobject *newto; teeobject *newto;
itertoolsmodule_state *state = itertoolsmodule_find_state_by_type(Py_TYPE(to)); newto = PyObject_GC_New(teeobject, Py_TYPE(to));
newto = PyObject_GC_New(teeobject, state->tee_type);
if (newto == NULL) if (newto == NULL)
return NULL; return NULL;
Py_INCREF(to->dataobj); Py_INCREF(to->dataobj);