-- Remove and return the top priority item

function PriorityQueue:Pop()
	local heap = self.heap
	local orig = heap[1][1]
	
	heap[1] = heap[self.current_size]
	heap[self.current_size] = nil
	
	self.current_size -= 1
	self:sink()
	
	return orig
end

return PriorityQueue
