summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-04 14:52:15 (GMT)
committerGitHub <noreply@github.com>2020-03-04 14:52:15 (GMT)
commit702e09fd0ad72b248b5adfa0fcfdb58600be77f6 (patch)
treecd5d37345071729547b7b0a52c5931f74ba25606
parenta6d3546d003d9873de0f71b319ad79d203374bf0 (diff)
downloadcpython-702e09fd0ad72b248b5adfa0fcfdb58600be77f6.zip
cpython-702e09fd0ad72b248b5adfa0fcfdb58600be77f6.tar.gz
cpython-702e09fd0ad72b248b5adfa0fcfdb58600be77f6.tar.bz2
bpo-39770, array module: Remove unnecessary descriptor counting (GH-18675)
-rw-r--r--Modules/arraymodule.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index b41ba05..95ee5f8 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2991,7 +2991,6 @@ array_modexec(PyObject *m)
{
char buffer[Py_ARRAY_LENGTH(descriptors)], *p;
PyObject *typecodes;
- Py_ssize_t size = 0;
const struct arraydescr *descr;
if (PyType_Ready(&Arraytype) < 0)
@@ -3009,10 +3008,6 @@ array_modexec(PyObject *m)
return -1;
}
- for (descr=descriptors; descr->typecode != '\0'; descr++) {
- size++;
- }
-
p = buffer;
for (descr = descriptors; descr->typecode != '\0'; descr++) {
*p++ = (char)descr->typecode;