Fixes loop variables to be the same types as their limit (GH-120958)

This commit is contained in:
Steve Dower 2024-06-24 17:11:47 +01:00 committed by GitHub
parent 2e157851e3
commit e731554337
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 26 additions and 26 deletions

View file

@ -8373,7 +8373,7 @@ PyUnicode_BuildEncodingMap(PyObject* string)
int count2 = 0, count3 = 0;
int kind;
const void *data;
Py_ssize_t length;
int length;
Py_UCS4 ch;
if (!PyUnicode_Check(string) || !PyUnicode_GET_LENGTH(string)) {
@ -8382,8 +8382,7 @@ PyUnicode_BuildEncodingMap(PyObject* string)
}
kind = PyUnicode_KIND(string);
data = PyUnicode_DATA(string);
length = PyUnicode_GET_LENGTH(string);
length = Py_MIN(length, 256);
length = (int)Py_MIN(PyUnicode_GET_LENGTH(string), 256);
memset(level1, 0xFF, sizeof level1);
memset(level2, 0xFF, sizeof level2);