Skip to content

Commit 3adcbe1

Browse files
committed
Fix comments for heapq.siftup_max()
1 parent 0f866cb commit 3adcbe1

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
@@ -459,11 +459,11 @@ siftup_max(PyListObject *heap, Py_ssize_t pos)
459459
return -1;
460460
}
461461

462-
/* Bubble up the smaller child until hitting a leaf. */
462+
/* Bubble up the larger child until hitting a leaf. */
463463
arr = _PyList_ITEMS(heap);
464464
limit = endpos >> 1; /* smallest pos that has no child */
465465
while (pos < limit) {
466-
/* Set childpos to index of smaller child. */
466+
/* Set childpos to index of larger child. */
467467
childpos = 2*pos + 1; /* leftmost child position */
468468
if (childpos + 1 < endpos) {
469469
PyObject* a = arr[childpos + 1];
@@ -483,7 +483,7 @@ siftup_max(PyListObject *heap, Py_ssize_t pos)
483483
return -1;
484484
}
485485
}
486-
/* Move the smaller child up. */
486+
/* Move the larger child up. */
487487
tmp1 = arr[childpos];
488488
tmp2 = arr[pos];
489489
arr[childpos] = tmp2;

0 commit comments

Comments
 (0)