bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)

This commit is contained in:
Jordon Xu 2019-09-11 00:04:08 +08:00 committed by Steve Dower
parent 801f925998
commit 2ec7010206
7 changed files with 15 additions and 15 deletions

View file

@ -987,7 +987,7 @@ _gethash(const char *s, int len, int scale)
unsigned long h = 0;
unsigned long ix;
for (i = 0; i < len; i++) {
h = (h * scale) + (unsigned char) Py_TOUPPER(Py_CHARMASK(s[i]));
h = (h * scale) + (unsigned char) Py_TOUPPER(s[i]);
ix = h & 0xff000000;
if (ix)
h = (h ^ ((ix>>24) & 0xff)) & 0x00ffffff;
@ -1157,7 +1157,7 @@ _cmpname(PyObject *self, int code, const char* name, int namelen)
if (!_getucname(self, code, buffer, NAME_MAXLEN, 1))
return 0;
for (i = 0; i < namelen; i++) {
if (Py_TOUPPER(Py_CHARMASK(name[i])) != buffer[i])
if (Py_TOUPPER(name[i]) != buffer[i])
return 0;
}
return buffer[namelen] == '\0';