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

Method push

queue/bytes_queue.go:142–156  ·  view source on GitHub ↗
(data []byte, len int)

Source from the content-addressed store, hash-verified

140}
141
142func (q *BytesQueue) push(data []byte, len int) {
143 headerEntrySize := binary.PutUvarint(q.headerBuffer, uint64(len))
144 q.copy(q.headerBuffer, headerEntrySize)
145
146 q.copy(data, len-headerEntrySize)
147
148 if q.tail > q.head {
149 q.rightMargin = q.tail
150 }
151 if q.tail == q.head {
152 q.full = true
153 }
154
155 q.count++
156}
157
158func (q *BytesQueue) copy(data []byte, len int) {
159 q.tail += copy(q.array[q.tail:], data[:len])

Callers 2

PushMethod · 0.95

Calls 1

copyMethod · 0.95

Tested by

no test coverage detected