File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2024,13 +2024,6 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
20242024 const unsigned char * q , * e ;
20252025 int bo = 0 ; /* assume native ordering by default */
20262026 const char * errmsg = "" ;
2027- /* On narrow builds we split characters outside the BMP into two
2028- codepoints => count how much extra space we need. */
2029- #ifndef Py_UNICODE_WIDE
2030- for (i = pairs = 0 ; i < size /4 ; i ++ )
2031- if (((Py_UCS4 * )s )[i ] >= 0x10000 )
2032- pairs ++ ;
2033- #endif
20342027 /* Offsets from q for retrieving bytes in the right order. */
20352028#ifdef BYTEORDER_IS_LITTLE_ENDIAN
20362029 int iorder [] = {0 , 1 , 2 , 3 };
@@ -2039,6 +2032,13 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
20392032#endif
20402033 PyObject * errorHandler = NULL ;
20412034 PyObject * exc = NULL ;
2035+ /* On narrow builds we split characters outside the BMP into two
2036+ codepoints => count how much extra space we need. */
2037+ #ifndef Py_UNICODE_WIDE
2038+ for (i = pairs = 0 ; i < size /4 ; i ++ )
2039+ if (((Py_UCS4 * )s )[i ] >= 0x10000 )
2040+ pairs ++ ;
2041+ #endif
20422042
20432043 /* This might be one to much, because of a BOM */
20442044 unicode = _PyUnicode_New ((size + 3 )/4 + pairs );
You can’t perform that action at this time.
0 commit comments