File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ _PyTuple_MaybeUntrack(PyObject *op)
145145 t = (PyTupleObject * ) op ;
146146 n = Py_SIZE (t );
147147 for (i = 0 ; i < n ; i ++ ) {
148- PyObject * item = PyTuple_GET_ITEM ( t , i ) ;
148+ PyObject * item = t -> ob_item [ i ] ;
149149 /* Tuple with NULL elements aren't
150150 fully constructed, don't untrack
151151 them yet. */
@@ -156,16 +156,15 @@ _PyTuple_MaybeUntrack(PyObject *op)
156156 _PyObject_GC_UNTRACK (op );
157157}
158158
159+ //
159160static bool
160161tuple_need_tracking (PyTupleObject * self )
161162{
162163 Py_ssize_t n = PyTuple_GET_SIZE (self );
163164 for (Py_ssize_t i = 0 ; i < n ; i ++ ) {
164- PyObject * item = PyTuple_GET_ITEM (self , i );
165- /* Tuple with NULL elements aren't
166- fully constructed, we should track them. */
167- if (!item ||
168- _PyObject_GC_MAY_BE_TRACKED (item )) {
165+ PyObject * item = self -> ob_item [i ];
166+ assert (item );
167+ if (_PyObject_GC_MAY_BE_TRACKED (item )) {
169168 return true;
170169 }
171170 }
You can’t perform that action at this time.
0 commit comments