https://github.com/python/cpython/commit/67c74398fa63cf49e3760eb792e09d79594d78af commit: 67c74398fa63cf49e3760eb792e09d79594d78af branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: kumaraditya303 <[email protected]> date: 2025-07-03T10:15:01Z summary:
[3.13] Fix comments for `heapq.siftup_max` (GH-135359) (#136233) Fix comments for `heapq.siftup_max` (GH-135359) (cherry picked from commit 8f8bdf251a5f79d15ac2b1a6d19860033bf50c79) Co-authored-by: Alper <[email protected]> Co-authored-by: mpage <[email protected]> files: M Modules/_heapqmodule.c diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index 695ce22f8049df..3e7857a420c2e3 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c @@ -445,11 +445,11 @@ siftup_max(PyListObject *heap, Py_ssize_t pos) return -1; } - /* Bubble up the smaller child until hitting a leaf. */ + /* Bubble up the larger child until hitting a leaf. */ arr = _PyList_ITEMS(heap); limit = endpos >> 1; /* smallest pos that has no child */ while (pos < limit) { - /* Set childpos to index of smaller child. */ + /* Set childpos to index of larger child. */ childpos = 2*pos + 1; /* leftmost child position */ if (childpos + 1 < endpos) { PyObject* a = arr[childpos + 1]; @@ -469,7 +469,7 @@ siftup_max(PyListObject *heap, Py_ssize_t pos) return -1; } } - /* Move the smaller child up. */ + /* Move the larger child up. */ tmp1 = arr[childpos]; tmp2 = arr[pos]; arr[childpos] = tmp2; _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
