MCPcopy Index your code
hub / github.com/allegro/bigcache / canInsertBeforeHead

Method canInsertBeforeHead

queue/bytes_queue.go:261–269  ·  view source on GitHub ↗

canInsertBeforeHead returns true if it's possible to insert an entry of size of need before the head of the queue

(need int)

Source from the content-addressed store, hash-verified

259
260// canInsertBeforeHead returns true if it's possible to insert an entry of size of need before the head of the queue
261func (q *BytesQueue) canInsertBeforeHead(need int) bool {
262 if q.full {
263 return false
264 }
265 if q.tail >= q.head {
266 return q.head-leftMarginIndex == need || q.head-leftMarginIndex >= need+minimumHeaderSize
267 }
268 return q.head-q.tail == need || q.head-q.tail >= need+minimumHeaderSize
269}

Callers 1

PushMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected