MCPcopy
hub / github.com/garethgeorge/backrest / Reset

Method Reset

internal/queue/timepriorityqueue.go:42–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42func (t *TimePriorityQueue[T]) Reset() []T {
43 t.tqueue.mu.Lock()
44 defer t.tqueue.mu.Unlock()
45 var res []T
46 for t.ready.Len() > 0 {
47 res = append(res, heap.Pop(&t.ready).(priorityEntry[T]).v)
48 }
49 for t.tqueue.heap.Len() > 0 {
50 res = append(res, heap.Pop(&t.tqueue.heap).(timeQueueEntry[priorityEntry[T]]).v.v)
51 }
52 return res
53}
54
55func (t *TimePriorityQueue[T]) GetAll() []T {
56 t.tqueue.mu.Lock()

Callers

nothing calls this directly

Calls 4

LockMethod · 0.80
PopMethod · 0.80
UnlockMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected