Skip to content

Commit 8f8bdf2

Browse files
yoneympage
andauthored
Fix comments for heapq.siftup_max (python#135359)
Co-authored-by: mpage <mpage@meta.com>
1 parent e0245c7 commit 8f8bdf2

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
@@ -463,11 +463,11 @@ siftup_max(PyListObject *heap, Py_ssize_t pos)
463463
return -1;
464464
}
465465

466-
/* Bubble up the smaller child until hitting a leaf. */
466+
/* Bubble up the larger child until hitting a leaf. */
467467
arr = _PyList_ITEMS(heap);
468468
limit = endpos >> 1; /* smallest pos that has no child */
469469
while (pos < limit) {
470-
/* Set childpos to index of smaller child. */
470+
/* Set childpos to index of larger child. */
471471
childpos = 2*pos + 1; /* leftmost child position */
472472
if (childpos + 1 < endpos) {
473473
PyObject* a = arr[childpos + 1];
@@ -487,7 +487,7 @@ siftup_max(PyListObject *heap, Py_ssize_t pos)
487487
return -1;
488488
}
489489
}
490-
/* Move the smaller child up. */
490+
/* Move the larger child up. */
491491
tmp1 = arr[childpos];
492492
tmp2 = arr[pos];
493493
FT_ATOMIC_STORE_PTR_RELAXED(arr[childpos], tmp2);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy