From: Alper Date: Thu, 3 Jul 2025 09:51:41 +0000 (-0700) Subject: Fix comments for `heapq.siftup_max` (#135359) X-Git-Tag: v3.15.0a1~1105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f8bdf251a5f79d15ac2b1a6d19860033bf50c79;p=thirdparty%2FPython%2Fcpython.git Fix comments for `heapq.siftup_max` (#135359) Co-authored-by: mpage --- diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index 560fe431fcac..05d01acd7710 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c @@ -463,11 +463,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]; @@ -487,7 +487,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]; FT_ATOMIC_STORE_PTR_RELAXED(arr[childpos], tmp2);