MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / maybeCompactLocked

Method maybeCompactLocked

internal/redisqueue/queue.go:243–257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241}
242
243func (q *queue) maybeCompactLocked() {
244 if q.head == 0 {
245 return
246 }
247 if q.head >= len(q.items) {
248 q.items = nil
249 q.head = 0
250 return
251 }
252 if q.head < 1024 && q.head*2 < len(q.items) {
253 return
254 }
255 q.items = append([]queueItem(nil), q.items[q.head:]...)
256 q.head = 0
257}

Callers 2

enqueueMethod · 0.95
popOldestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected