Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 67c7439

Browse files
miss-islingtonyoneympage
authoredJul 3, 2025··
[3.13] Fix comments for heapq.siftup_max (GH-135359) (#136233)
Fix comments for `heapq.siftup_max` (GH-135359) (cherry picked from commit 8f8bdf2) Co-authored-by: Alper <alperyoney@fb.com> Co-authored-by: mpage <mpage@meta.com>
1 parent 1de8fc3 commit 67c7439

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)
Please sign in to comment.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant