Qaribou\Collection\ImmArray::sortHeap PHP Method

sortHeap() public method

Tends to run much faster than array or merge sorts, since you're only sorting the pointers, and the sort function is running in a highly optimized space.
public sortHeap ( SplHeap $heap ) : ImmArray
$heap SplHeap The heap to run for sorting
return ImmArray
    public function sortHeap(SplHeap $heap)
    {
        foreach ($this as $item) {
            $heap->insert($item);
        }
        return static::fromItems($heap);
    }