summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-09-08 17:35:49 (GMT)
committerGitHub <noreply@github.com>2017-09-08 17:35:49 (GMT)
commit2b7953d974dbe5adc0937394c93f31c46cf01517 (patch)
tree00d8e3a6f8dce7138749136a057e0ce2fd0d6e8a /Objects
parente3b2b4b8d9e751b49e3550cb83ba39b54fdc377c (diff)
downloadcpython-2b7953d974dbe5adc0937394c93f31c46cf01517.zip
cpython-2b7953d974dbe5adc0937394c93f31c46cf01517.tar.gz
cpython-2b7953d974dbe5adc0937394c93f31c46cf01517.tar.bz2
replace custom table with pyctype (#3456)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/codeobject.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index adef625..f312f33 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -14,17 +14,6 @@ typedef struct {
static int
all_name_chars(PyObject *o)
{
- /* [a-zA-Z0-9_] */
- static const bool ok_name_char[128] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
- };
const unsigned char *s, *e;
if (!PyUnicode_IS_ASCII(o))
@@ -33,7 +22,7 @@ all_name_chars(PyObject *o)
s = PyUnicode_1BYTE_DATA(o);
e = s + PyUnicode_GET_LENGTH(o);
for (; s != e; s++) {
- if (!ok_name_char[*s])
+ if (!Py_ISALNUM(*s) && *s != '_')
return 0;
}
return 1;