MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / resize

Method resize

AdaptixServer/core/utils/safe/queue.go:100–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100func (q *Queue) resize() {
101 newCap := q.capacity * 2
102 newBuf := make([]interface{}, newCap)
103
104 for i := 0; i < q.size; i++ {
105 newBuf[i] = q.buffer[(q.head+i)%q.capacity]
106 }
107 q.buffer = newBuf
108 q.head = 0
109 q.tail = q.size
110 q.capacity = newCap
111}
112
113func (q *Queue) RemoveIf(predicate func(v interface{}) bool) (bool, interface{}) {
114 q.lock.Lock()

Callers 2

PushMethod · 0.95
PushFrontMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected