aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn1t0r <git@n1t0r.com>2023-01-14 11:39:58 +1100
committern1t0r <git@n1t0r.com>2023-04-01 19:18:26 +1100
commitbd7fb7e33678f59c71cec00112bf3f03ea67f9e6 (patch)
tree2f48459ab3a34208ffd51a3cd88898e5aeb92bcf
parent38ec0c02f039036502155c2e8f02540dc9f2d4fb (diff)
downloadsteady-bd7fb7e33678f59c71cec00112bf3f03ea67f9e6.tar.gz
steady-bd7fb7e33678f59c71cec00112bf3f03ea67f9e6.tar.bz2
steady-bd7fb7e33678f59c71cec00112bf3f03ea67f9e6.zip
Fix old name for Push function.
-rw-r--r--priority_queue.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/priority_queue.go b/priority_queue.go
index 98f0aee..941b0ac 100644
--- a/priority_queue.go
+++ b/priority_queue.go
@@ -15,7 +15,7 @@ type priorityQueue[T any] struct {
// Len returns the number of elements in the queue.
func (pq *priorityQueue[T]) Len() int { return pq.items.Len() }
-// Enqueue enqueues an item into the queue.
+// Push enqueues an item into the queue.
func (pq *priorityQueue[T]) Push(value T, priority int64) {
it := &item[T]{value, priority}
heap.Push(&pq.items, it)
@@ -28,7 +28,7 @@ func (pq *priorityQueue[T]) Peek() (T, int64) {
return it.value, it.priority
}
-// Dequeue dequeues the item from the queue with the least priority.
+// Pop dequeues the item from the queue with the least priority.
func (pq *priorityQueue[T]) Pop() (T, int64) {
it := heap.Pop(&pq.items).(*item[T])
return it.value, it.priority