@@ -12808,7 +12808,7 @@ _PyUnicodeWriter_Init(_PyUnicodeWriter *writer, Py_ssize_t min_length)
1280812808 writer -> kind = 5 ; /* invalid kind */
1280912809#endif
1281012810 writer -> min_length = Py_MAX (min_length , 100 );
12811- writer -> flags . overallocate = (min_length > 0 );
12811+ writer -> overallocate = (min_length > 0 );
1281212812}
1281312813
1281412814int
@@ -12827,7 +12827,7 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
1282712827 newlen = writer -> pos + length ;
1282812828
1282912829 if (writer -> buffer == NULL ) {
12830- if (writer -> flags . overallocate ) {
12830+ if (writer -> overallocate ) {
1283112831 /* overallocate 25% to limit the number of resize */
1283212832 if (newlen <= (PY_SSIZE_T_MAX - newlen / 4 ))
1283312833 newlen += newlen / 4 ;
@@ -12842,23 +12842,23 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
1284212842 }
1284312843
1284412844 if (newlen > writer -> size ) {
12845- if (writer -> flags . overallocate ) {
12845+ if (writer -> overallocate ) {
1284612846 /* overallocate 25% to limit the number of resize */
1284712847 if (newlen <= (PY_SSIZE_T_MAX - newlen / 4 ))
1284812848 newlen += newlen / 4 ;
1284912849 if (newlen < writer -> min_length )
1285012850 newlen = writer -> min_length ;
1285112851 }
1285212852
12853- if (maxchar > writer -> maxchar || writer -> flags . readonly ) {
12853+ if (maxchar > writer -> maxchar || writer -> readonly ) {
1285412854 /* resize + widen */
1285512855 newbuffer = PyUnicode_New (newlen , maxchar );
1285612856 if (newbuffer == NULL )
1285712857 return -1 ;
1285812858 _PyUnicode_FastCopyCharacters (newbuffer , 0 ,
1285912859 writer -> buffer , 0 , writer -> pos );
1286012860 Py_DECREF (writer -> buffer );
12861- writer -> flags . readonly = 0 ;
12861+ writer -> readonly = 0 ;
1286212862 }
1286312863 else {
1286412864 newbuffer = resize_compact (writer -> buffer , newlen );
@@ -12869,7 +12869,7 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
1286912869 _PyUnicodeWriter_Update (writer );
1287012870 }
1287112871 else if (maxchar > writer -> maxchar ) {
12872- assert (!writer -> flags . readonly );
12872+ assert (!writer -> readonly );
1287312873 newbuffer = PyUnicode_New (writer -> size , maxchar );
1287412874 if (newbuffer == NULL )
1287512875 return -1 ;
@@ -12895,11 +12895,11 @@ _PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str)
1289512895 return 0 ;
1289612896 maxchar = PyUnicode_MAX_CHAR_VALUE (str );
1289712897 if (maxchar > writer -> maxchar || len > writer -> size - writer -> pos ) {
12898- if (writer -> buffer == NULL && !writer -> flags . overallocate ) {
12898+ if (writer -> buffer == NULL && !writer -> overallocate ) {
1289912899 Py_INCREF (str );
1290012900 writer -> buffer = str ;
1290112901 _PyUnicodeWriter_Update (writer );
12902- writer -> flags . readonly = 1 ;
12902+ writer -> readonly = 1 ;
1290312903 writer -> size = 0 ;
1290412904 writer -> pos += len ;
1290512905 return 0 ;
@@ -12921,7 +12921,7 @@ _PyUnicodeWriter_Finish(_PyUnicodeWriter *writer)
1292112921 Py_INCREF (unicode_empty );
1292212922 return unicode_empty ;
1292312923 }
12924- if (writer -> flags . readonly ) {
12924+ if (writer -> readonly ) {
1292512925 assert (PyUnicode_GET_LENGTH (writer -> buffer ) == writer -> pos );
1292612926 return writer -> buffer ;
1292712927 }
@@ -13638,7 +13638,7 @@ PyUnicode_Format(PyObject *format, PyObject *args)
1363813638 goto onError ;
1363913639 }
1364013640 if (fmtcnt == 0 )
13641- writer .flags . overallocate = 0 ;
13641+ writer .overallocate = 0 ;
1364213642
1364313643 if (c == '%' ) {
1364413644 if (_PyUnicodeWriter_Prepare (& writer , 1 , '%' ) == -1 )
0 commit comments