summaryrefslogtreecommitdiffstats
path: root/Modules/gcmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-04-15 15:54:09 (GMT)
committerGitHub <noreply@github.com>2019-04-15 15:54:09 (GMT)
commit0810fa79885276114d1a94e2ce61da367ebb1ffc (patch)
tree6c03706fd677e4c73ea6afa6a8da75ebcbb348e8 /Modules/gcmodule.c
parentaba7d662abbb847f9f45c6db58242a9b4bf65bff (diff)
downloadcpython-0810fa79885276114d1a94e2ce61da367ebb1ffc.zip
cpython-0810fa79885276114d1a94e2ce61da367ebb1ffc.tar.gz
cpython-0810fa79885276114d1a94e2ce61da367ebb1ffc.tar.bz2
bpo-36389: Cleanup gc.set_threshold() (GH-12844)
Don't assign generations[2].threshold to generations[2].threshold: useless operation.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r--Modules/gcmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index fad1356..a75d5fe 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -1374,7 +1374,7 @@ gc_set_thresh(PyObject *self, PyObject *args)
&_PyRuntime.gc.generations[1].threshold,
&_PyRuntime.gc.generations[2].threshold))
return NULL;
- for (i = 2; i < NUM_GENERATIONS; i++) {
+ for (i = 3; i < NUM_GENERATIONS; i++) {
/* generations higher than 2 get the same threshold */
_PyRuntime.gc.generations[i].threshold = _PyRuntime.gc.generations[2].threshold;
}
@@ -1524,7 +1524,7 @@ gc_get_objects_impl(PyObject *module, Py_ssize_t generation)
}
/* If generation is passed, we extract only that generation */
- if (generation != -1) {
+ if (generation != -1) {
if (generation >= NUM_GENERATIONS) {
PyErr_Format(PyExc_ValueError,
"generation parameter must be less than the number of "