Qaribou\Collection\ImmArray::sortHeap PHP 메소드

sortHeap() 공개 메소드

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
리턴 ImmArray
    public function sortHeap(SplHeap $heap)
    {
        foreach ($this as $item) {
            $heap->insert($item);
        }
        return static::fromItems($heap);
    }