diff options
author | Jordon Xu <46997731+qigangxu@users.noreply.github.com> | 2019-09-10 16:04:08 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@python.org> | 2019-09-10 16:04:08 (GMT) |
commit | 2ec70102066fe5534f1a62e8f496d2005e1697db (patch) | |
tree | 1d406e9e646da303521b874bf46acca47c203b67 /Modules/unicodedata.c | |
parent | 801f925998cc393260f36f5ac77369fef2373ad1 (diff) | |
download | cpython-2ec70102066fe5534f1a62e8f496d2005e1697db.zip cpython-2ec70102066fe5534f1a62e8f496d2005e1697db.tar.gz cpython-2ec70102066fe5534f1a62e8f496d2005e1697db.tar.bz2 |
bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)
Diffstat (limited to 'Modules/unicodedata.c')
-rw-r--r-- | Modules/unicodedata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index bb09b7d..e99d914 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -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'; |