Commits

Victor Stinner committed e8dc02c

initlen

Comments (0)

Files changed (1)

Objects/unicodeobject.c

             /* overallocate by 100% to limit the number of resize */
             if (newlen <= PY_SSIZE_T_MAX / 2)
                 newlen *= 2;
+            if (writer->initlen > newlen)
+                newlen = writer->initlen;
             if (newlen < 100)
                 newlen = 100;
             else if (writer->initlen > newlen)