summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorJordon Xu <46997731+qigangxu@users.noreply.github.com>2019-09-10 16:04:08 (GMT)
committerSteve Dower <steve.dower@python.org>2019-09-10 16:04:08 (GMT)
commit2ec70102066fe5534f1a62e8f496d2005e1697db (patch)
tree1d406e9e646da303521b874bf46acca47c203b67 /Modules
parent801f925998cc393260f36f5ac77369fef2373ad1 (diff)
downloadcpython-2ec70102066fe5534f1a62e8f496d2005e1697db.zip
cpython-2ec70102066fe5534f1a62e8f496d2005e1697db.tar.gz
cpython-2ec70102066fe5534f1a62e8f496d2005e1697db.tar.bz2
bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_struct.c4
-rw-r--r--Modules/_tkinter.c4
-rw-r--r--Modules/unicodedata.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 5fdfdf9..c387ae2 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1298,7 +1298,7 @@ prepare_s(PyStructObject *self)
len = 0;
ncodes = 0;
while ((c = *s++) != '\0') {
- if (Py_ISSPACE(Py_CHARMASK(c)))
+ if (Py_ISSPACE(c))
continue;
if ('0' <= c && c <= '9') {
num = c - '0';
@@ -1363,7 +1363,7 @@ prepare_s(PyStructObject *self)
s = fmt;
size = 0;
while ((c = *s++) != '\0') {
- if (Py_ISSPACE(Py_CHARMASK(c)))
+ if (Py_ISSPACE(c))
continue;
if ('0' <= c && c <= '9') {
num = c - '0';
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index a832099..036f9b6 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -671,8 +671,8 @@ Tkapp_New(const char *screenName, const char *className,
}
strcpy(argv0, className);
- if (Py_ISUPPER(Py_CHARMASK(argv0[0])))
- argv0[0] = Py_TOLOWER(Py_CHARMASK(argv0[0]));
+ if (Py_ISUPPER(argv0[0]))
+ argv0[0] = Py_TOLOWER(argv0[0]);
Tcl_SetVar(v->interp, "argv0", argv0, TCL_GLOBAL_ONLY);
PyMem_Free(argv0);
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';