MCPcopy Create free account
hub / github.com/evcc-io/evcc / Dequeue

Method Dequeue

util/queue.go:19–28  ·  view source on GitHub ↗

Dequeue removes and returns the front element of the queue. It returns false if the queue was empty.

()

Source from the content-addressed store, hash-verified

17
18// Dequeue removes and returns the front element of the queue. It returns false if the queue was empty.
19func (q *Queue[T]) Dequeue() (val T, ok bool) {
20 if q.IsEmpty() {
21 return
22 }
23
24 val = q.data[0]
25 q.data = q.data[1:]
26
27 return val, true
28}
29
30// First returns the front element of the queue. It returns false if the queue was empty.
31func (q *Queue[T]) First() (val T, ok bool) {

Callers 1

processTasksMethod · 0.80

Calls 1

IsEmptyMethod · 0.95

Tested by

no test coverage detected