Lines Matching defs:pos
25 siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
33 if (pos >= size) {
41 newitem = arr[pos];
42 while (pos > startpos) {
43 parentpos = (pos - 1) >> 1;
61 newitem = arr[pos];
63 arr[pos] = parent;
64 pos = parentpos;
70 siftup(PyListObject *heap, Py_ssize_t pos)
78 startpos = pos;
79 if (pos >= endpos) {
86 limit = endpos >> 1; /* smallest pos that has no child */
87 while (pos < limit) {
89 childpos = 2*pos + 1; /* leftmost child position */
110 tmp2 = arr[pos];
112 arr[pos] = tmp1;
113 pos = childpos;
116 return siftdown(heap, startpos, pos);
394 siftdown_max(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
402 if (pos >= size) {
410 newitem = arr[pos];
411 while (pos > startpos) {
412 parentpos = (pos - 1) >> 1;
430 newitem = arr[pos];
432 arr[pos] = parent;
433 pos = parentpos;
439 siftup_max(PyListObject *heap, Py_ssize_t pos)
447 startpos = pos;
448 if (pos >= endpos) {
455 limit = endpos >> 1; /* smallest pos that has no child */
456 while (pos < limit) {
458 childpos = 2*pos + 1; /* leftmost child position */
479 tmp2 = arr[pos];
481 arr[pos] = tmp1;
482 pos = childpos;
485 return siftdown_max(heap, startpos, pos);