@@ -741,8 +741,7 @@ static PyObject *
741
741
teedataobject_jumplink (teedataobject * tdo )
742
742
{
743
743
if (tdo -> nextlink == NULL ) {
744
- PyTypeObject * tp = Py_TYPE (tdo );
745
- itertools_state * state = find_state_by_type (tp );
744
+ itertools_state * state = get_module_state_by_cls (Py_TYPE (tdo ));
746
745
tdo -> nextlink = teedataobject_newinternal (state , tdo -> it );
747
746
}
748
747
return Py_XNewRef (tdo -> nextlink );
@@ -811,7 +810,7 @@ teedataobject_clear(teedataobject *tdo)
811
810
Py_CLEAR (tdo -> values [i ]);
812
811
tmp = tdo -> nextlink ;
813
812
tdo -> nextlink = NULL ;
814
- itertools_state * state = find_state_by_type (Py_TYPE (tdo ));
813
+ itertools_state * state = get_module_state_by_cls (Py_TYPE (tdo ));
815
814
teedataobject_safe_decref (tmp , state -> teedataobject_type );
816
815
return 0 ;
817
816
}
@@ -862,7 +861,7 @@ itertools_teedataobject_impl(PyTypeObject *type, PyObject *it,
862
861
teedataobject * tdo ;
863
862
Py_ssize_t i , len ;
864
863
865
- itertools_state * state = find_state_by_type (type );
864
+ itertools_state * state = get_module_state_by_cls (type );
866
865
assert (type == state -> teedataobject_type );
867
866
868
867
tdo = (teedataobject * )teedataobject_newinternal (state , it );
@@ -1013,7 +1012,7 @@ static PyObject *
1013
1012
itertools__tee_impl (PyTypeObject * type , PyObject * iterable )
1014
1013
/*[clinic end generated code: output=b02d3fd26c810c3f input=adc0779d2afe37a2]*/
1015
1014
{
1016
- itertools_state * state = find_state_by_type (type );
1015
+ itertools_state * state = get_module_state_by_cls (type );
1017
1016
return tee_fromiterable (state , iterable );
1018
1017
}
1019
1018
@@ -1051,8 +1050,8 @@ tee_setstate(teeobject *to, PyObject *state)
1051
1050
PyErr_SetString (PyExc_TypeError , "state is not a tuple" );
1052
1051
return NULL ;
1053
1052
}
1054
- itertools_state * m_state = find_state_by_type (Py_TYPE (to ));
1055
- PyTypeObject * tdo_type = m_state -> teedataobject_type ;
1053
+ itertools_state * mod_st = get_module_state_by_cls (Py_TYPE (to ));
1054
+ PyTypeObject * tdo_type = mod_st -> teedataobject_type ;
1056
1055
if (!PyArg_ParseTuple (state , "O!i" , tdo_type , & tdo , & index )) {
1057
1056
return NULL ;
1058
1057
}
0 commit comments