From 55cee70766f48b6dd54932000e652dddd8c8c732 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 3 Jan 2021 10:38:00 +0100 Subject: [PATCH] Address review: fix performance issue in tee_copy() --- Modules/itertoolsmodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index f9fcd550a90..05b2f039e38 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -787,8 +787,7 @@ tee_copy(teeobject *to, PyObject *Py_UNUSED(ignored)) { teeobject *newto; - itertoolsmodule_state *state = itertoolsmodule_find_state_by_type(Py_TYPE(to)); - newto = PyObject_GC_New(teeobject, state->tee_type); + newto = PyObject_GC_New(teeobject, Py_TYPE(to)); if (newto == NULL) return NULL; Py_INCREF(to->dataobj);