parameters: (heap, startpos, pos)
docstring: Maxheap variant of _siftdown
docstring_summary: Maxheap variant of _siftdown
docstring_tokens: Maxheap variant of _siftdown
function: def _siftdown_max(heap, startpos, pos):
      'Maxheap variant of _siftdown'
      newitem = heap[pos]
      # Follow the path to the root, moving parents down until finding a place
      # newitem fits.
      while pos > startpos:
          parentpos = (pos - 1) >> 1
          parent = heap[parentpos]
          if parent < newitem:
              heap[pos] = parent
              pos = parentpos
              continue
          break
      heap[pos] = newitem
function_tokens: def _siftdown_max ( heap , startpos , pos ) : newitem = heap [ pos ] # Follow the path to the root, moving parents down until finding a place # newitem fits. while pos > startpos : parentpos = ( pos - 1 ) >> 1 parent = heap [ parentpos ] if parent < newitem : heap [ pos ] = parent pos = parentpos continue break heap [ pos ] = newitem