Skip to content

Commit 1c54b6a

Browse files
committed
Cleanup
1 parent 4a4b9ff commit 1c54b6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Objects/unicodeobject.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6106,6 +6106,7 @@ _PyUnicode_EncodeUTF32(PyObject *str,
61066106
#else
61076107
int native_ordering = byteorder >= 0;
61086108
#endif
6109+
61096110
if (kind == PyUnicode_1BYTE_KIND) {
61106111
// gh-139156: Don't use PyBytesWriter API here since it has an overhead
61116112
// on short strings
@@ -6155,8 +6156,6 @@ _PyUnicode_EncodeUTF32(PyObject *str,
61556156
PyObject *rep = NULL;
61566157

61576158
for (Py_ssize_t pos = 0; pos < len; ) {
6158-
Py_ssize_t newpos, repsize, moreunits;
6159-
61606159
if (kind == PyUnicode_2BYTE_KIND) {
61616160
pos += ucs2lib_utf32_encode((const Py_UCS2 *)data + pos, len - pos,
61626161
&out, native_ordering);
@@ -6169,13 +6168,15 @@ _PyUnicode_EncodeUTF32(PyObject *str,
61696168
if (pos == len)
61706169
break;
61716170

6171+
Py_ssize_t newpos;
61726172
rep = unicode_encode_call_errorhandler(
61736173
errors, &errorHandler,
61746174
encoding, "surrogates not allowed",
61756175
str, &exc, pos, pos + 1, &newpos);
61766176
if (!rep)
61776177
goto error;
61786178

6179+
Py_ssize_t repsize, moreunits;
61796180
if (PyBytes_Check(rep)) {
61806181
repsize = PyBytes_GET_SIZE(rep);
61816182
if (repsize & 3) {

0 commit comments

Comments
 (0)