Skip to content

Commit 0810fa7

Browse files
authored
bpo-36389: Cleanup gc.set_threshold() (GH-12844)
Don't assign generations[2].threshold to generations[2].threshold: useless operation.
1 parent aba7d66 commit 0810fa7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Modules/gcmodule.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ gc_set_thresh(PyObject *self, PyObject *args)
13741374
&_PyRuntime.gc.generations[1].threshold,
13751375
&_PyRuntime.gc.generations[2].threshold))
13761376
return NULL;
1377-
for (i = 2; i < NUM_GENERATIONS; i++) {
1377+
for (i = 3; i < NUM_GENERATIONS; i++) {
13781378
/* generations higher than 2 get the same threshold */
13791379
_PyRuntime.gc.generations[i].threshold = _PyRuntime.gc.generations[2].threshold;
13801380
}
@@ -1524,7 +1524,7 @@ gc_get_objects_impl(PyObject *module, Py_ssize_t generation)
15241524
}
15251525

15261526
/* If generation is passed, we extract only that generation */
1527-
if (generation != -1) {
1527+
if (generation != -1) {
15281528
if (generation >= NUM_GENERATIONS) {
15291529
PyErr_Format(PyExc_ValueError,
15301530
"generation parameter must be less than the number of "

0 commit comments

Comments
 (0)