Skip to content

Commit 40c3cad

Browse files
yoneympage
authored andcommitted
Fix comments for heapq.siftup_max (pythonGH-135359)
(cherry picked from commit 8f8bdf2) Co-authored-by: Alper <[email protected]> Co-authored-by: mpage <[email protected]>
1 parent 1de8fc3 commit 40c3cad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/_heapqmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,11 @@ siftup_max(PyListObject *heap, Py_ssize_t pos)
445445
return -1;
446446
}
447447

448-
/* Bubble up the smaller child until hitting a leaf. */
448+
/* Bubble up the larger child until hitting a leaf. */
449449
arr = _PyList_ITEMS(heap);
450450
limit = endpos >> 1; /* smallest pos that has no child */
451451
while (pos < limit) {
452-
/* Set childpos to index of smaller child. */
452+
/* Set childpos to index of larger child. */
453453
childpos = 2*pos + 1; /* leftmost child position */
454454
if (childpos + 1 < endpos) {
455455
PyObject* a = arr[childpos + 1];
@@ -469,7 +469,7 @@ siftup_max(PyListObject *heap, Py_ssize_t pos)
469469
return -1;
470470
}
471471
}
472-
/* Move the smaller child up. */
472+
/* Move the larger child up. */
473473
tmp1 = arr[childpos];
474474
tmp2 = arr[pos];
475475
arr[childpos] = tmp2;

0 commit comments

Comments
 (0)