diff options
author | Guido van Rossum <guido@python.org> | 2023-03-13 22:08:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 22:08:45 (GMT) |
commit | 392f2ad3cbf2e1f24656fe0410a9b65882257582 (patch) | |
tree | 7195ee7c9ba670dc38d745dfe7493e11e7736aa2 /Python/generated_cases.c.h | |
parent | 959ea2f9e967042954878f7af5c85053238212a7 (diff) | |
download | cpython-392f2ad3cbf2e1f24656fe0410a9b65882257582.zip cpython-392f2ad3cbf2e1f24656fe0410a9b65882257582.tar.gz cpython-392f2ad3cbf2e1f24656fe0410a9b65882257582.tar.bz2 |
gh-98831: Use DECREF_INPUTS() more (#102409)
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r-- | Python/generated_cases.c.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 631b784..b1dbb58 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -1568,8 +1568,8 @@ PyObject **pieces = (stack_pointer - oparg); PyObject *str; str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg); - for (int i = 0; i < oparg; i++) { - Py_DECREF(pieces[i]); + for (int _i = oparg; --_i >= 0;) { + Py_DECREF(pieces[_i]); } if (str == NULL) { STACK_SHRINK(oparg); goto error; } STACK_SHRINK(oparg); @@ -1665,9 +1665,8 @@ if (map == NULL) goto error; - for (int i = 0; i < oparg; i++) { - Py_DECREF(values[i*2]); - Py_DECREF(values[i*2+1]); + for (int _i = oparg*2; --_i >= 0;) { + Py_DECREF(values[_i]); } if (map == NULL) { STACK_SHRINK(oparg*2); goto error; } STACK_SHRINK(oparg*2); @@ -1732,10 +1731,10 @@ map = _PyDict_FromItems( &PyTuple_GET_ITEM(keys, 0), 1, values, 1, oparg); - Py_DECREF(keys); - for (int i = 0; i < oparg; i++) { - Py_DECREF(values[i]); + for (int _i = oparg; --_i >= 0;) { + Py_DECREF(values[_i]); } + Py_DECREF(keys); if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; } STACK_SHRINK(oparg); stack_pointer[-1] = map; |