File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14051,20 +14051,16 @@ PyUnicode_Format(PyObject *format, PyObject *args)
1405114051 }
1405214052 }
1405314053 /* Copy all characters, preserving len */
14054- if (temp != NULL ) {
14055- assert (pbuf == PyUnicode_DATA (temp ));
14056- v = PyUnicode_Substring (temp , pindex , pindex + len );
14054+ if (pindex == 0 && len == PyUnicode_GET_LENGTH (temp )) {
14055+ r = _PyAccu_Accumulate (& acc , temp );
1405714056 }
1405814057 else {
14059- const char * p = (const char * ) pbuf ;
14060- assert (pbuf != NULL );
14061- p += kind * pindex ;
14062- v = PyUnicode_FromKindAndData (kind , p , len );
14058+ v = PyUnicode_Substring (temp , pindex , pindex + len );
14059+ if (v == NULL )
14060+ goto onError ;
14061+ r = _PyAccu_Accumulate (& acc , v );
14062+ Py_DECREF (v );
1406314063 }
14064- if (v == NULL )
14065- goto onError ;
14066- r = _PyAccu_Accumulate (& acc , v );
14067- Py_DECREF (v );
1406814064 if (r )
1406914065 goto onError ;
1407014066 if (width > len && repeat_accumulate (& acc , blank , width - len ))
You can’t perform that action at this time.
0 commit comments