aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordon Xu <46997731+qigangxu@users.noreply.github.com>2019-09-11 00:04:08 +0800
committerSteve Dower <steve.dower@python.org>2019-09-10 17:04:08 +0100
commit2ec70102066fe5534f1a62e8f496d2005e1697db (patch)
tree1d406e9e646da303521b874bf46acca47c203b67 /Modules
parentbpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests op... (diff)
downloadcpython-2ec70102066fe5534f1a62e8f496d2005e1697db.tar.gz
cpython-2ec70102066fe5534f1a62e8f496d2005e1697db.tar.bz2
cpython-2ec70102066fe5534f1a62e8f496d2005e1697db.zip
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 5fdfdf9da63..c387ae2ffc1 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 a832099c095..036f9b68bb2 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 bb09b7d21f3..e99d914b797 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';