function TimerQueue::swap
2 calls to TimerQueue::swap()
- TimerQueue::heapifyDown in vendor/
revolt/ event-loop/ src/ EventLoop/ Internal/ TimerQueue.php - TimerQueue::heapifyUp in vendor/
revolt/ event-loop/ src/ EventLoop/ Internal/ TimerQueue.php
File
-
vendor/
revolt/ event-loop/ src/ EventLoop/ Internal/ TimerQueue.php, line 125
Class
- TimerQueue
- Uses a binary tree stored in an array to implement a heap.
Namespace
Revolt\EventLoop\InternalCode
private function swap(int $left, int $right) : void {
$temp = $this->callbacks[$left];
$this->callbacks[$left] = $this->callbacks[$right];
$this->pointers[$this->callbacks[$right]->id] = $left;
$this->callbacks[$right] = $temp;
$this->pointers[$temp->id] = $right;
}