You are here

protected function FastPriorityQueue::nextAndRemove in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-stdlib/src/FastPriorityQueue.php \Zend\Stdlib\FastPriorityQueue::nextAndRemove()

Set the iterator pointer to the next element in the queue removing the previous element

1 call to FastPriorityQueue::nextAndRemove()
FastPriorityQueue::extract in vendor/zendframework/zend-stdlib/src/FastPriorityQueue.php
Extract an element in the queue according to the priority and the order of insertion

File

vendor/zendframework/zend-stdlib/src/FastPriorityQueue.php, line 192

Class

FastPriorityQueue
This is an efficient implementation of an integer priority queue in PHP

Namespace

Zend\Stdlib

Code

protected function nextAndRemove() {
  if (false === next($this->values[$this->maxPriority])) {
    unset($this->priorities[$this->maxPriority]);
    unset($this->values[$this->maxPriority]);
    $this->maxPriority = empty($this->priorities) ? 0 : max($this->priorities);
    $this->subIndex = -1;
  }
  ++$this->index;
  ++$this->subIndex;
  --$this->count;
}