File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -10971,19 +10971,22 @@ unicode_compare(PyObject *str1, PyObject *str2)
1097110971static int
1097210972unicode_compare_eq (PyObject * str1 , PyObject * str2 )
1097310973{
10974- Py_ssize_t len = PyUnicode_GET_LENGTH ( str1 ) ;
10975- if ( PyUnicode_GET_LENGTH ( str2 ) != len ) {
10976- return 0 ;
10977- }
10974+ int kind ;
10975+ const void * data1 , * data2 ;
10976+ Py_ssize_t len ;
10977+ int cmp ;
1097810978
10979- int kind = PyUnicode_KIND (str1 );
10980- if (PyUnicode_KIND (str2 ) != kind ) {
10979+ len = PyUnicode_GET_LENGTH (str1 );
10980+ if (PyUnicode_GET_LENGTH (str2 ) != len )
1098110981 return 0 ;
10982- }
10982+ kind = PyUnicode_KIND (str1 );
10983+ if (PyUnicode_KIND (str2 ) != kind )
10984+ return 0 ;
10985+ data1 = PyUnicode_DATA (str1 );
10986+ data2 = PyUnicode_DATA (str2 );
1098310987
10984- const void * data1 = PyUnicode_DATA (str1 );
10985- const void * data2 = PyUnicode_DATA (str2 );
10986- return (memcmp (data1 , data2 , len * kind ) == 0 );
10988+ cmp = memcmp (data1 , data2 , len * kind );
10989+ return (cmp == 0 );
1098710990}
1098810991
1098910992int
You can’t perform that action at this time.
0 commit comments