@@ -1659,8 +1659,6 @@ encoder_listencode_list(PyEncoderObject *s, _PyAccu *acc,
16591659 static PyObject * empty_array = NULL ;
16601660 PyObject * ident = NULL ;
16611661 PyObject * s_fast = NULL ;
1662- Py_ssize_t num_items ;
1663- PyObject * * seq_items ;
16641662 Py_ssize_t i ;
16651663
16661664 if (open_array == NULL || close_array == NULL || empty_array == NULL ) {
@@ -1674,8 +1672,7 @@ encoder_listencode_list(PyEncoderObject *s, _PyAccu *acc,
16741672 s_fast = PySequence_Fast (seq , "_iterencode_list needs a sequence" );
16751673 if (s_fast == NULL )
16761674 return -1 ;
1677- num_items = PySequence_Fast_GET_SIZE (s_fast );
1678- if (num_items == 0 ) {
1675+ if (PySequence_Fast_GET_SIZE (s_fast ) == 0 ) {
16791676 Py_DECREF (s_fast );
16801677 return _PyAccu_Accumulate (acc , empty_array );
16811678 }
@@ -1696,7 +1693,6 @@ encoder_listencode_list(PyEncoderObject *s, _PyAccu *acc,
16961693 }
16971694 }
16981695
1699- seq_items = PySequence_Fast_ITEMS (s_fast );
17001696 if (_PyAccu_Accumulate (acc , open_array ))
17011697 goto bail ;
17021698 if (s -> indent != Py_None ) {
@@ -1708,8 +1704,8 @@ encoder_listencode_list(PyEncoderObject *s, _PyAccu *acc,
17081704 buf += newline_indent
17091705 */
17101706 }
1711- for (i = 0 ; i < num_items ; i ++ ) {
1712- PyObject * obj = seq_items [ i ] ;
1707+ for (i = 0 ; i < PySequence_Fast_GET_SIZE ( s_fast ) ; i ++ ) {
1708+ PyObject * obj = PySequence_Fast_GET_ITEM ( s_fast , i ) ;
17131709 if (i ) {
17141710 if (_PyAccu_Accumulate (acc , s -> item_separator ))
17151711 goto bail ;
0 commit comments